/// <summary>
        /// 订单 回退(k3:销售订单使用)
        /// </summary>
        /// <param name="dh"></param>
        /// <returns></returns>
        public static string Ddht(string dh)
        {
            string ret = "";
            Dictionary <string, string> param = new Dictionary <string, string>();

            param.Add("orderno", dh);
            ret = FcyWeb.Post("/ws/Orders/orderConfirmBackApi", param);
            return(ret);
        }
        /// <summary>
        /// 删除付款单
        /// </summary>
        /// <param name="cOutSysKey"></param>
        /// <returns></returns>
        public static string Zfddel(string cOutSysKey)
        {
            string ret = "";
            Dictionary <string, string> param = new Dictionary <string, string>();

            param.Add("cOutSysKey", cOutSysKey);
            ret = FcyWeb.Post("/ws/Payments/delPayment", param);
            return(ret);
        }
        /// <summary>
        /// 删除U订货上的"发货通知单"(k3对应:应收单)
        /// </summary>
        /// <param name="cOutSysKey"></param>
        /// <returns></returns>
        public static string Xsfhdelup(string cOutSysKey)
        {
            string ret = "";
            Dictionary <string, string> param = new Dictionary <string, string>();

            param.Add("cOutSysKey", cOutSysKey);
            ret = FcyWeb.Post("/ws/Orders/delDelivery", param);
            return(ret);
        }
        /// <summary>
        /// 关闭U订货单据明细行
        /// </summary>
        /// <param name="dh">单据号</param>
        /// <param name="ddid">明细行ID</param>
        /// <returns></returns>
        public static string Ddclose(string dh, string ddid)
        {
            var ret = "";
            Dictionary <string, string> param = new Dictionary <string, string>();

            param.Add("orderno", dh);
            param.Add("orderdetailid", ddid);
            ret = FcyWeb.Post("/ws/Orders/closedOrderDetailApi", param);
            return(ret);
        }
        /// <summary>
        /// 上传应收单
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        public static string Ysdup(DataRow row)
        {
            string ret = "";

            fcydata.Service ab = new fcydata.Service();
            if (row["je"].ToString().Trim().IndexOf("-") > 0)
            {
                row["je"] = -(decimal)row["je"];
                MessageBox.Show(row["je"].ToString());
                Dictionary <string, string> param = new Dictionary <string, string>();

                DateTime date = (DateTime)row["rq"];
                string   strs = "{'iAmount':<je>,'cOutSysKey':'<dh>','oAgent':{'cCode':'<khbh>','cOutSysKey':'<khbh>'},'oSettlementWay':{'cErpCode':'<jsfs>'},'iPayMentStatusCode':2,'cRefundPayDirection': 'TOUDH','dPayFinishDate':'" + date.ToString("yyyy-MM-dd HH:mm:ss") + "','dReceiptDate':'" + date.ToString("yyyy-MM-dd HH:mm:ss") + "','remark':'<memo>'}";

                for (int j = 0; j < row.Table.Columns.Count; j++)
                {
                    strs = strs.Replace("<" + row.Table.Columns[j].ColumnName + ">", row[j].ToString().Trim());
                }
                param.Add("refund", strs);
                ret = FcyWeb.Post("/ws/Payments/saveRefund", param);
                XmlDocument xmldoc = new XmlDocument();
                xmldoc.LoadXml(ret);
                if (fcydata.FcyXml.GetNodeVal(xmldoc.DocumentElement, "data") != "")
                {
                    MessageBox.Show(ret);
                }
            }
            else
            {
                Dictionary <string, string> param = new Dictionary <string, string>();

                DateTime date = (DateTime)row["rq"];
                string   strs = "{'iAmount':<je>,'cOutSysKey':'<dh>','oAgent':{'cErpCode':'<khbh>'},'oSettlementWay':{'cErpCode':'<jsfs>'},'cVoucherType':'NORMAL','iPayMentStatusCode':2,'dPayFinishDate':'" + date.ToString("yyyy-MM-dd HH:mm:ss") + "','dReceiptDate':'" + date.ToString("yyyy-MM-dd HH:mm:ss") + "','remark':'<memo>'}";

                for (int j = 0; j < row.Table.Columns.Count; j++)
                {
                    strs = strs.Replace("<" + row.Table.Columns[j].ColumnName + ">", row[j].ToString().Trim());
                }
                param.Add("payment", strs);

                ret = FcyWeb.Post("/ws/Payments/savePayment", param);
                XmlDocument xmldoc = new XmlDocument();
                xmldoc.LoadXml(ret);
                if (fcydata.FcyXml.GetNodeVal(xmldoc.DocumentElement, "data") != "")
                {
                    MessageBox.Show(ret);
                }
            }
            return(ret);
        }