福途教育网
专业的教育资讯网站

当前位置:福途教育网 > 会计师 > 正文

金蝶打印模板设置怎么设置

时间:2024/5/29 0:47:04 编辑:福途教育 标签:会计师

榜单说明:福途教育网榜单是编辑部门通过资料收集整理,并基于互联网大数据统计及人为根据市场和参数条件变化的分析而得出本站站内排序!排名不分先后,仅供参考,具体价格等信息以实地考察为准。

2024年【会计师】申请条件/费用/专业咨询 >>

会计师申请条件是什么?会计师费用是多少?会计师专业都有哪些?

点击咨询

    本文解答了关于《金蝶打印模板设置》相关内容,同时关于1、金蝶打印模板设置怎么设置,2、金蝶打印模板设置在哪里找,3、金蝶打印模板设置在那里找到系统管理,4、金蝶打印模板设置的5行打出来是4行,5、金蝶的打印设置,的相关问答本篇文章福途教育网小编也整理了进来,希望对您有帮助。

    金蝶打印模板设置怎么设置

    金蝶打印模板设置

    ///

    public static void ModelBack()

    {

    var path = AppDomain.CurrentDomain.BaseDirectory + "ModelBack\\fpzd.xml";

    ModelSet(path);

    }

    ///

    /// 金蝶打印模板设置

    ///

    ///

    public static void ModelSet(string path)

    {

    int rcode = 0;

    string ser = "(local)";

    string id = CurrentUserInfo.user;

    string pu = CurrentUserInfo.pass;

    string timeout = "3"; //连接超时,单位秒

    int hBingo = KingdeeK3.FlexPlus.KdPrint.PrintServerConnect(ser, id, pu, timeout, ref rcode);

    try

    {

    if (hBingo == 0)

    throw new Exception($"KdPrint的连接失败:{rcode}");

    if (KingdeeK3.FlexPlus.KdPrint.PrintModelLoad(hBingo, path, 0, ref rcode) == 0)

    throw new Exception($"加载模板失败:{rcode}");

    if (KingdeeK3.FlexPlus.KdPrint.PrintServerLogout(hBingo, ref rcode) == 0)

    throw new Exception($"退出登录失败:{rcode}");

    KingdeeK3.FlexPlus.KdPrint.PrintServerDisconnect(hBingo, ref rcode);

    }

    catch (Exception ex)

    {

    TextHelper.Error(ex.Message);

    }

    }

    #endregion

    #region T 实现

    const string AppId = "YDJY2010";

    const string Secret = "B578C50"),890A940D.,1B)SYe.602@]50";

    static readonly string UrlPay = "http://erp.ydsoft.cn:8070/Pay/pay";

    static readonly string UrlOrder = "http://erp.ydsoft.cn:8070/order/order";

    private static readonly JObject ayParams = JObject.FromObject(new PayParams { AppId = AppId });

    private static readonly JObject orderParams = JObject.FromObject(new OrderParams { AppId = AppId });

    ///

    /// 支付

    ///

    /// 订单Id

    ///

    public static bool Pay(string orderId)

    {

    return Pay(orderId, null);

    }

    ///

    /// 支付

    ///

    ///

    /// 短信验证码

    ///

    public static bool Pay(string orderId, int? smsCode)

    {

    try

    {

    var client = new HttpClient();

    ayParams.Property("OutTradeNo").Value = orderId;

    if (smsCode.HasValue)

    ayParams.Property("smsCode").Value = smsCode.Value;

    var sign = Signer.Sign(ayParams, Secret);

    ayParams.Property("sign").Value = sign;

    var resStr = client.PostAsync(UrlPay, new StringContent(ayParams.ToString(), Encoding.UTF8, "application/json")).GetAwaiter().GetResult().Content.ReadAsStringAsync().GetAwaiter().GetResult();

    var resJson = JObject.Parse(resStr);

    if (resJson["respCode"].ToString() == "0000")

    return true;

    ctx.Execute(cmd =>

    {

    cmd.CommandText = "update sm_outtt_main set FNote=@FNote where FNumber=@FNumber";

    cmd.Parameters.Add(SqlHelper.GetParameter("@FNote", resStr));

    cmd.Parameters.Add(SqlHelper.GetParameter("@FNumber", orderId));

    cmd.ExecuteNonQuery();

    });

    }

    catch (Exception ex)

    {

    TextHelper.Error(ex.Message);

    }

    return false;

    }

    class PayParams

    {

    public string AppId { get; set; }

    public string OutTradeNo { get; set; }

    public string sign { get; set; }

    public string smsCode { get; set; }

    }

    ///

    /// 订单

    ///

    /// 订单Id

    /// 金额

    ///

    public static bool Order(string orderId, decimal price)

    {

    try

    {

    var client = new HttpClient();

    orderParams.Property("OutTradeNo").Value = orderId;

    orderParams.Property("Price").Value = new decimal(price).ToString();

    var sign = Signer.Sign(orderParams, Secret);

    orderParams.Property("sign").Value = sign;

    var resStr = client.PostAsync(UrlOrder, new StringContent(orderParams.ToString(), Encoding.UTF8, "application/json")).GetAwaiter().GetResult().Content.ReadAsStringAsync().GetAwaiter().GetResult();

    var resJson = JObject.Parse(resStr);

    if (resJson["respCode"].ToString() == "0000")

    return true;

    ctx.Execute(cmd =>

    {

    cmd.CommandText = "update sm_outtt_main set FNote=@FNote where FNumber=@FNumber";

    cmd.Parameters.Add(SqlHelper.GetParameter("@FNote", resStr));

    cmd.Parameters.Add(SqlHelper.GetParameter("@FNumber", orderId));

    cmd.ExecuteNonQuery();

    });

    }

    catch (Exception ex)

    {

    TextHelper.Error(ex.Message);

    }

    return false;

    }

    class OrderParams

    {

    public string AppId { get; set; }

    public string OutTradeNo { get; set; }

    public string FreeTimeOut { get; set; }

    public string Price { get; set; }

    public string SignType { get; set; } = "MD5";

    public string sign { get; set; }

    }

    #endregion

    }

    }

    总结:以上是编辑:【紫含精灵】整理及AI智能原创关于《

    金蝶打印模板设置

    》优质内容解答希望能帮助到您。

以上手机版 金蝶打印模板设置怎么设置 小编为您整理金蝶打印模板设置怎么设置的全部内容,以上内容仅供参考。

点击查看 会计师 更多内容

热门推荐

最新文章