//U8类库:U8Distribute.dll(U8SOFT\EAI\) Interop.U8Distribute.dll(U8SOFT\Interop\) //ProgID:U8Distribute.iDistribute //方法; String Process(String RequestXml) private void button5_Click(object sender, EventArgs e) { string requesXml = ""; U8Distribute.iDistributeClass eaiBroker = new U8Distribute.iDistributeClass(); String responseXml = eaiBroker.Process(requesXml); System.Runtime.InteropServices.Marshal.FinalReleaseComObject(eaiBroker); }
public string getEAIPercess(string DataXML) { try { //引用U8SOFT\EAI\U8Distribute.dll U8Distribute.iDistributeClass eaiBroker = new U8Distribute.iDistributeClass(); //创建EAI服务代理接口对象 String responseXml = eaiBroker.Process(DataXML); //调用EAI服务代理的数据交换方法Process,传入Request交换消息, 并获取EAI返回的Response消息。 //处理返回结果 System.Runtime.InteropServices.Marshal.FinalReleaseComObject(eaiBroker); //释放EAI服务代理接口对象 return(responseXml); } catch (Exception e) { return(e.Message.ToString()); } }
private void button5_Click(object sender, EventArgs e) { Dictionary <string, string> d1 = moban.clearCloneDictVal(moban.entryMoban);//克隆 //Dictionary<string, string> d1 = new Dictionary<string, string>(moban.entryMoban);//克隆 moban.rootAttr["sender"] = "001"; moban.rootAttr["roottag"] = moban.mobanType; moban.rootAttr["proc"] = "add"; moban.headerDict["code"] = "0000000001"; //单据号 相同单据号时会自动编号,但不能为空 moban.headerDict["date"] = DateTime.Now.ToString(); //单据日期 入库日期 moban.headerDict["receiveflag"] = "1"; //收发标志 入库单-收 1,出库单-发 0 moban.headerDict["vouchtype"] = "10"; //'单据类型 10 产成品入库 moban.headerDict["businesstype"] = "成品入库"; //业务类型 moban.headerDict["source"] = "库存"; //单据来源 采购、销售、库存、存货 moban.headerDict["warehousecode"] = "2"; //仓库编码 moban.headerDict["receivecode"] = "12"; //收发类别编码 moban.headerDict["departmentcode"] = ""; //部门编码 moban.headerDict["personcode"] = ""; //职员编码 业务员 moban.headerDict["handler"] = "范磊"; //经手人 moban.headerDict["maker"] = "范磊"; //制单人 moban.headerDict["memory"] = ""; //备注 moban.headerDict["chandler"] = ""; //审核人 moban.headerDict["auditdate"] = ""; //审核日期 d1["inventorycode"] = "MTVMC"; //存货编码 d1["invname"] = "PVC密度板橱柜吊柜门"; //存货名称 d1["free1"] = "YD01YG0-CG1"; //商品代码 -吉屋用 d1["free2"] = "SF20088-03PCT"; //表面色 -吉屋用 d1["quantity"] = "1"; //数量 d1["cmassunitname"] = "套"; //主记量单位名称 d1["price"] = "999"; //单价 d1["cost"] = "999"; //金额 d1["makedate"] = ""; //生产日期 d1["define30"] = "YD01YG0001"; //订单号 -吉屋用 d1["iexpiratdatecalcu"] = "0"; //有效期推算方式 moban.entryList.Add(d1); XmlDocument dom = moban.combineU8Xml(); //先要引用D:\U8SOFT\Interop\Interop.U8Distribute.dll U8Distribute.iDistributeClass eaibroker = new U8Distribute.iDistributeClass(); try { String responseXml = eaibroker.Process(dom.OuterXml); string s; bool suc = moban.parseU8XmlRs(responseXml, out s); if (suc) { MessageBox.Show("导入成功!" + s); } else { MessageBox.Show("导入失败!" + s); } } finally { System.Runtime.InteropServices.Marshal.FinalReleaseComObject(eaibroker); //COM释放 } }