private void button6_Click(object sender, EventArgs e) { string xmlData = ""; try { this.Cursor = Cursors.WaitCursor; if (dgv2.Rows.Count > 0) { dgv2.Rows.Clear(); } xmlData = ""; xmlData = xmlData + @"<?xml version=""1.0"" encoding=""utf-8""?>"; xmlData = xmlData + "<XMLDATA>"; xmlData = xmlData + "<HEAD>"; xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> "; xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> "; xmlData = xmlData + "<BZXX></BZXX> "; xmlData = xmlData + "</HEAD> "; xmlData = xmlData + "<MAIN>"; xmlData = xmlData + "<FBRQ></FBRQ> "; xmlData = xmlData + "<YPTBDM>" + textBox1.Text.Trim() + "</YPTBDM> "; xmlData = xmlData + "</MAIN>"; xmlData = xmlData + "</XMLDATA>"; DataSet ds = SendMessage.QuryData("YQ018", xmlData); if (ds != null && ClsSystem.gnvl(ds.Tables[0].Rows[0]["ZTCLJG"], "") == "00000") { DataTable db = ds.Tables[3]; cxdb = ds.Tables[3]; if (db.Rows.Count > 0) { for (int i = 0; i < db.Rows.Count; i++) { dgv2.Rows.Add(); dgv2.Rows[i].Cells["SFWJ"].Value = ClsSystem.gnvl(ds.Tables[1].Rows[0]["SFWJ"], ""); dgv2.Rows[i].Cells["JLS"].Value = ClsSystem.gnvl(ds.Tables[1].Rows[0]["JLS"], ""); dgv2.Rows[i].Cells["YPTBDM"].Value = ClsSystem.gnvl(db.Rows[i]["YPTBDM"], ""); dgv2.Rows[i].Cells["PZWH"].Value = ClsSystem.gnvl(db.Rows[i]["PZWH"], ""); dgv2.Rows[i].Cells["BWM"].Value = ClsSystem.gnvl(db.Rows[i]["BWM"], ""); dgv2.Rows[i].Cells["YPTYM"].Value = ClsSystem.gnvl(db.Rows[i]["YPTYM"], ""); dgv2.Rows[i].Cells["JX"].Value = ClsSystem.gnvl(db.Rows[i]["JX"], ""); dgv2.Rows[i].Cells["GG"].Value = ClsSystem.gnvl(db.Rows[i]["GG"], ""); dgv2.Rows[i].Cells["SCQY"].Value = ClsSystem.gnvl(db.Rows[i]["SCQY"], ""); dgv2.Rows[i].Cells["SPM"].Value = ClsSystem.gnvl(db.Rows[i]["SPM"], ""); dgv2.Rows[i].Cells["BZSL"].Value = ClsSystem.gnvl(db.Rows[i]["BZSL"], ""); dgv2.Rows[i].Cells["BZCZ"].Value = ClsSystem.gnvl(db.Rows[i]["BZCZ"], ""); dgv2.Rows[i].Cells["BZFS"].Value = ClsSystem.gnvl(db.Rows[i]["BZFS"], ""); dgv2.Rows[i].Cells["GGBZWZBS"].Value = ClsSystem.gnvl(db.Rows[i]["GGBZWZBS"], ""); dgv2.Rows[i].Cells["JCXXQYRQ"].Value = ClsSystem.gnvl(db.Rows[i]["JCXXQYRQ"], ""); dgv2.Rows[i].Cells["JJDW"].Value = ClsSystem.gnvl(db.Rows[i]["JJDW"], ""); dgv2.Rows[i].Cells["JHJGGZDM"].Value = ClsSystem.gnvl(db.Rows[i]["JHJGGZDM"], ""); dgv2.Rows[i].Cells["JHGZJGJE"].Value = ClsSystem.gnvl(db.Rows[i]["JHGZJGJE"], ""); dgv2.Rows[i].Cells["XSJGGZDM"].Value = ClsSystem.gnvl(db.Rows[i]["XSJGGZDM"], ""); dgv2.Rows[i].Cells["XSGZJGJE"].Value = ClsSystem.gnvl(db.Rows[i]["XSGZJGJE"], ""); dgv2.Rows[i].Cells["WJGZQYRQ"].Value = ClsSystem.gnvl(db.Rows[i]["WJGZQYRQ"], ""); dgv2.Rows[i].Cells["CGFS"].Value = ClsSystem.gnvl(db.Rows[i]["CGFS"], ""); dgv2.Rows[i].Cells["CGZT"].Value = ClsSystem.gnvl(db.Rows[i]["CGZT"], ""); dgv2.Rows[i].Cells["GZYJ"].Value = ClsSystem.gnvl(db.Rows[i]["GZYJ"], ""); dgv2.Rows[i].Cells["YSGZQYRQ"].Value = ClsSystem.gnvl(db.Rows[i]["YSGZQYRQ"], ""); dgv2.Rows[i].Cells["ZSFBRQ"].Value = ClsSystem.gnvl(db.Rows[i]["ZSFBRQ"], ""); } } } else { MessageBox.Show(ClsSystem.gnvl(ds.Tables[0].Rows[0]["CWXX"], ""), "错误", MessageBoxButtons.OK); } this.Cursor = Cursors.Default; // MessageBox.Show("未上传的存货查询完成", "提示", MessageBoxButtons.OK); } catch (Exception ex) { this.Cursor = Cursors.Default; MessageBox.Show(ex.Message.ToString(), "错误", MessageBoxButtons.OK); return; } }
private string Qury01(string cType) { string xmlData = ""; string ResultXml = ""; string czlx = "1";//新增 string strsql = @"sselect cInvCCode as SPLX ,cInvDefine1 as YPLX, cInvName as tym,'' as CPM, '' as YWM, cInvName as SPM,cInvDefine2 as YPSPTXM, cInvDefine3 as YPJX, cInvStd as GG,cEnterprise as SCQYMC,'' as CPLB,'' as YPBWM,cFile as YPPZWH, '' as BZCZ,'' as BZDW,cPackingType as CGYYDW,'' as BZSL,'' as BZFS,'' as TZMS from inventory where isnull(cInvDefine10,'')<>'' "; DataTable db = SqlAccess.ExecuteSqlDataTable(strsql, conn); if (db.Rows.Count > 0) { for (int i = 0; i < db.Rows.Count; i++) { xmlData = ""; ResultXml = ""; xmlData = @"<?xml version=""1.0"" encoding=""utf-8""?>"; xmlData = xmlData + "<XMLDATA>"; xmlData = xmlData + "<HEAD>"; xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP>"; xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC>"; xmlData = xmlData + "<BZXX/>"; xmlData = xmlData + "</HEAD>"; xmlData = xmlData + "<MAIN>"; xmlData = xmlData + "<CZLX>" + czlx + "</CZLX>"; xmlData = xmlData + "<SPLX>" + ClsSystem.gnvl(db.Rows[i]["SPLX"], "") + "</SPLX>"; xmlData = xmlData + "<YPLX>" + ClsSystem.gnvl(db.Rows[i]["YPLX"], "") + "</YPLX>"; xmlData = xmlData + "<TYM>" + ClsSystem.gnvl(db.Rows[i]["TYM"], "") + "</TYM>"; xmlData = xmlData + "<CPM>" + ClsSystem.gnvl(db.Rows[i]["CPM"], "") + "</CPM>"; xmlData = xmlData + "<YWM>" + ClsSystem.gnvl(db.Rows[i]["YWM"], "") + "</YWM>"; xmlData = xmlData + "<SPM>" + ClsSystem.gnvl(db.Rows[i]["SPM"], "") + "</SPM>"; xmlData = xmlData + "<YPSPTXM>" + ClsSystem.gnvl(db.Rows[i]["YPSPTXM"], "") + "</YPSPTXM>"; xmlData = xmlData + "<YPJX>" + ClsSystem.gnvl(db.Rows[i]["YPJX"], "") + "</YPJX>"; xmlData = xmlData + "<GG>" + ClsSystem.gnvl(db.Rows[i]["GG"], "") + "</GG>"; xmlData = xmlData + "<SCQYMC>" + ClsSystem.gnvl(db.Rows[i]["SCQYMC"], "") + "</SCQYMC>"; xmlData = xmlData + "<CPLB>" + ClsSystem.gnvl(db.Rows[i]["CPLB"], "") + "</CPLB>"; xmlData = xmlData + "<YPBWM>" + ClsSystem.gnvl(db.Rows[i]["YPBWM"], "") + "</YPBWM>"; xmlData = xmlData + "<YPPZWH>" + ClsSystem.gnvl(db.Rows[i]["YPPZWH"], "") + "</YPPZWH>"; xmlData = xmlData + "<BZCZ>" + ClsSystem.gnvl(db.Rows[i]["BZCZ"], "") + "</BZCZ>"; xmlData = xmlData + "<BZDW>" + ClsSystem.gnvl(db.Rows[i]["BZDW"], "") + "</BZDW>"; xmlData = xmlData + "<CGYYDW>" + ClsSystem.gnvl(db.Rows[i]["CGYYDW"], "") + "</CGYYDW>"; xmlData = xmlData + "<BZSL>" + ClsSystem.gnvl(db.Rows[i]["BZSL"], "") + "</BZSL>"; xmlData = xmlData + "<BZFS>" + ClsSystem.gnvl(db.Rows[i]["BZFS"], "") + "</BZFS>"; xmlData = xmlData + "<TZMS>" + ClsSystem.gnvl(db.Rows[i]["TZMS"], "") + "</TZMS>"; xmlData = xmlData + "</MAIN>"; xmlData = xmlData + "</XMLDATA>"; DataSet ds = SendMessage.QuryData(cType, xmlData); if (ds.Tables.Count > 0) { if (ClsSystem.gnvl(ds.Tables[0].Rows[0]["ZTCLJG"], "") == "00000") { xmlData = @"<?xml version=""1.0"" encoding=""utf-8""?>"; xmlData = xmlData + "<XMLDATA>"; xmlData = xmlData + "<HEAD>"; xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP>"; xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC>"; xmlData = xmlData + "<BZXX/>"; xmlData = xmlData + "</HEAD>"; xmlData = xmlData + "<MAIN>"; xmlData = xmlData + "<CXLX>07</CXLX>"; xmlData = xmlData + "<CXBH>" + ClsSystem.gnvl(db.Rows[i]["YPBWM"], "") + "</CXBH>"; xmlData = xmlData + "</MAIN>"; xmlData = xmlData + "</XMLDATA>"; DataSet rds = SendMessage.QuryData("YQ015", xmlData); if (rds.Tables.Count > 0) { if (ClsSystem.gnvl(rds.Tables[0].Rows[0]["ZTCLJG"], "") == "00000") { //strsql = "insert into YS_Interface_Records(cMaker,dDate,cType,cFlag,ExCode,errMsg) values(" // + "'',getdate(),'" + cType + "','成功','" + VouchNO + "','')"; // SqlAccess.ExecuteSql(strsql, conn); } } } } } } return(null); }