/// <summary> /// 销售订单导入NC /// </summary> /// <param name="NC_ID">NC主键</param> /// <param name="SaleCode">销售单据号</param> /// <param name="ConNO">合同号</param> /// <param name="D_NC_DATE">销售单据号日期</param> private void NC_SaleOrder(string NC_ID, string SaleCode, string ConNO, string D_NC_DATE) { ApiSaleOrder apisaleorder = new ApiSaleOrder(); List <ApiOrderDto> orderDto = new List <ApiOrderDto>(); ApiOrderDto dto = new ApiOrderDto(); dto.NC_ID = NC_ID; dto.SaleCode = SaleCode; dto.ConNO = ConNO; dto.D_NC_DATE = D_NC_DATE; orderDto.Add(dto); string result = ""; string filePath = "~/FileInterface/download/" + SaleCode + ".xml"; string xmlFileName = System.Web.HttpContext.Current.Server.MapPath(filePath); List <string> resList = apisaleorder.SendXmlOrder(orderDto, xmlFileName, ltlempid.Text); string jg = resList[0].ToString().ToString() == "1" ? "导入NC成功" : GetNCError(resList); result = "单据号:" + SaleCode + ",结果:" + jg; if (resList[0].ToString() == "1") { if (tmo_order.UpdateExeStatus(2, SaleCode))//更新执行状态 { this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + result + "');</script>", false); GetSale(); } } else { this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + result + "');</script>", false); } }
//销售订单导入NC protected void Button1_Click(object sender, EventArgs e) { #region //导入NC Mod_TMO_CON mod = tmo_con.GetModel(txtCON.Text); List <ApiOrderDto> orderDto = new List <ApiOrderDto>(); ApiOrderDto dto = new ApiOrderDto(); dto.NC_ID = ""; dto.SaleCode = txtConNo.Text; dto.ConNO = mod.C_CON_NO; dto.D_NC_DATE = mod.D_MOD_DT.ToString(); orderDto.Add(dto); string result = ""; string filePath = "~/FileInterface/download/" + txtConNo.Text + ".xml"; string xmlFileName = System.Web.HttpContext.Current.Server.MapPath(filePath); List <string> resList = apisaleorder.SendXmlOrder(orderDto, xmlFileName, ""); #endregion string jg = resList[0].ToString().ToString() == "1" ? "导入NC成功" : GetNCError(resList); result = "单据号:" + txtConNo.Text + ",结果:" + jg; WebMsg.MessageBox(result); }