protected override void InsertData(List <InvVolumeApp> ListModel) { try { if (base.customStyleDataGrid1.DataSource != null) { ((DataTable)base.customStyleDataGrid1.DataSource).Clear(); } if (this.CheckEmpty(ListModel)) { DataTable table = this.CreateTableHeader(); int num = 0; int yearExist = 0x7fffffff; foreach (InvVolumeApp app in ListModel) { if (((11 != app.InvType) && (0x33 != app.InvType)) && (0x29 != app.InvType)) { int number = app.Number; if (('0' != app.Status) && (number > 0)) { DataRow row = table.NewRow(); string invType = ShareMethods.GetInvType(app.InvType); row["FPZL"] = invType; row["KPXE"] = this.GetInvUpLimit(invType); row["JH"] = Convert.ToString(num++); row["LBDM"] = app.TypeCode; row["MC"] = ShareMethods.GetFPLBMC(app, base._dictFPLBBM); row["QSHM"] = ShareMethods.FPHMTo8Wei(app.HeadCode); row["SYZS"] = Convert.ToString(number); uint num4 = (app.HeadCode + app.Number) - 1; row["JZZH"] = num4.ToString().PadLeft(8, '0'); row["LGRQ"] = app.BuyDate.ToString("yyyy-MM-dd"); row["LGZS"] = app.BuyNumber.ToString(); if (app.BuyDate.Year < yearExist) { yearExist = app.BuyDate.Year; } table.Rows.Add(row); } } } base.customStyleDataGrid1.DataSource = table; this.InitializeQueryComponents(yearExist); } } catch (BaseException exception) { base._bError = true; this.loger.Error(exception.Message); ExceptionHandler.HandleError(exception); } catch (Exception exception2) { base._bError = true; this.loger.Error(exception2.Message); ExceptionHandler.HandleError(exception2); } }
private void InsertData(List <InvVolumeApp> ListModel) { try { if (this.csdgList.DataSource != null) { ((DataTable)this.csdgList.DataSource).Clear(); } if ((ListModel == null) || (ListModel.Count <= 0)) { MessageManager.ShowMsgBox("INP-441242"); } else { DataTable table = new DataTable(); table.Columns.Add("xz", typeof(bool)); table.Columns.Add("fpzl", typeof(string)); table.Columns.Add("fpdm", typeof(string)); table.Columns.Add("qshm", typeof(string)); table.Columns.Add("fpzs", typeof(string)); foreach (InvVolumeApp app in ListModel) { DataRow row = table.NewRow(); row["xz"] = true; row["fpzl"] = ShareMethods.GetInvType(app.InvType); row["fpdm"] = app.TypeCode; row["qshm"] = ShareMethods.FPHMTo8Wei(app.HeadCode); row["fpzs"] = Convert.ToString(app.Number); table.Rows.Add(row); } this.csdgList.DataSource = table; this.btnFpxz.Enabled = true; } } catch (BaseException exception) { this.loger.Error(exception.Message); ExceptionHandler.HandleError(exception); } catch (Exception exception2) { this.loger.Error(exception2.Message); ExceptionHandler.HandleError(exception2); } }
public void InsertInvVolume(List <InvVolumeApp> invList) { InvSQInfo invUpLimit = base.TaxCardInstance.get_SQInfo(); int num = 0; DataTable table = this.CreateTableHeader(); foreach (InvVolumeApp app in invList) { num = 0; DataRow row = table.NewRow(); string invType = ShareMethods.GetInvType(app.InvType); row[this.strHead[num++]] = invType; double upLimit = ShareMethods.GetUpLimit(invUpLimit, invType); row[this.strHead[num++]] = Convert.ToString(upLimit); row[this.strHead[num++]] = app.TypeCode; row[this.strHead[num++]] = ShareMethods.GetFPLBMC(app, this._dictFPLBBM); row[this.strHead[num++]] = ShareMethods.FPHMTo8Wei(app.HeadCode); int number = app.Number; row[this.strHead[num++]] = Convert.ToString(number); row[this.strHead[num++]] = app.BuyDate.ToString("yyyy-MM-dd"); table.Rows.Add(row); } this.dgInvInfo.DataSource = table; }
private bool ParseDownloadQueryOutput(XmlDocument doc, out string msg) { try { this.outList.Clear(); XmlNode node = doc.SelectSingleNode("//CODE"); XmlNode node2 = doc.SelectSingleNode("//MESS"); if (!node.InnerText.Equals("0000")) { msg = node2.InnerText; return(false); } XmlNodeList list = doc.SelectSingleNode("//GPXX").SelectNodes("//FPJXX"); if ((list != null) && (list.Count > 0)) { foreach (XmlNode node4 in list) { DownloadInfo item = new DownloadInfo(); foreach (XmlNode node5 in node4.ChildNodes) { if (node5.Name.Equals("FKPJH")) { item.machineNum = node5.InnerText; } else if (node5.Name.Equals("FPZL")) { item.typeName = ShareMethods.GetInvType(Convert.ToByte(node5.InnerText)); } else if (node5.Name.Equals("FPDM")) { item.typeCode = node5.InnerText; } else if (node5.Name.Equals("QSHM")) { item.startNum = node5.InnerText.PadLeft(8, '0'); } else if (node5.Name.Equals("ZZHM")) { item.endNum = node5.InnerText.PadLeft(8, '0'); } else if (node5.Name.Equals("FS")) { item.count = node5.InnerText; } else if (node5.Name.Equals("LGRQ")) { string innerText = node5.InnerText; item.buyDate = innerText.Substring(0, 4) + "-" + innerText.Substring(4, 2) + "-" + innerText.Substring(6, 2); } } this.outList.Add(item); } } msg = string.Empty; return(true); } catch (BaseException exception) { this.loger.Error(exception.Message); ExceptionHandler.HandleError(exception); msg = exception.Message; return(false); } catch (Exception exception2) { this.loger.Error(exception2.Message); ExceptionHandler.HandleError(exception2); msg = exception2.Message; return(false); } }
public static bool ParseAllocateQueryOutput(XmlDocument doc, out string msg, out List <AllocateInfo> outAllocList) { try { List <AllocateInfo> list = new List <AllocateInfo>(); XmlNode node = doc.SelectSingleNode("//CODE"); XmlNode node2 = doc.SelectSingleNode("//MESS"); if (!node.InnerText.Equals("0000")) { msg = node2.InnerText; outAllocList = null; return(false); } XmlNodeList list2 = doc.SelectSingleNode("//DATA").SelectNodes("//FPMX"); if ((list2 != null) && (list2.Count > 0)) { foreach (XmlNode node4 in list2) { AllocateInfo item = new AllocateInfo(); foreach (XmlNode node5 in node4.ChildNodes) { if (node5.Name.Equals("FKPJH")) { item.machineNum = node5.InnerText; } else if (node5.Name.Equals("FPZL")) { item.typeName = ShareMethods.GetInvType(Convert.ToByte(node5.InnerText)); } else if (node5.Name.Equals("LBDM")) { item.typeCode = node5.InnerText; } else if (node5.Name.Equals("QSHM")) { item.startNum = node5.InnerText.PadLeft(8, '0'); } else if (node5.Name.Equals("FPFS")) { item.count = node5.InnerText; } else if (node5.Name.Equals("FPZT")) { item.allocStatus = node5.InnerText; } else if (node5.Name.Equals("GMRQ")) { string innerText = node5.InnerText; item.buyDate = innerText.Substring(0, 4) + "-" + innerText.Substring(4, 2) + "-" + innerText.Substring(6, 2); } } int num = (Convert.ToInt32(item.startNum) + Convert.ToInt32(item.count)) - 1; item.endNum = num.ToString().PadLeft(8, '0'); list.Add(item); } } msg = string.Empty; outAllocList = list; return(true); } catch (BaseException exception) { loger.Error(exception.Message); ExceptionHandler.HandleError(exception); msg = exception.Message; outAllocList = null; return(false); } catch (Exception exception2) { loger.Error(exception2.Message); ExceptionHandler.HandleError(exception2); msg = exception2.Message; outAllocList = null; return(false); } }
protected virtual void QueryIndexChanged(object sender, EventArgs e) { try { if (this.queryInitialized) { this._ListModel = base.TaxCardInstance.GetInvStock(); if (0 < base.TaxCardInstance.get_RetCode()) { MessageManager.ShowMsgBox(base.TaxCardInstance.get_ErrCode()); this._bError = true; base.Close(); } else { if (this.customStyleDataGrid1.DataSource != null) { ((DataTable)this.customStyleDataGrid1.DataSource).Clear(); } DataTable table = this.CreateTableHeader(); int num = 0; int num2 = 0; while (num2 < this._ListModel.Count) { DataRow row = table.NewRow(); string invType = ShareMethods.GetInvType(this._ListModel[num2].InvType); if (this.InvTypeMatched(invType)) { row["FPZL"] = invType; DateTime buyDate = this._ListModel[num2].BuyDate; if (this.InvYearMatched(buyDate.Year.ToString()) && this.InvMonthMatched(buyDate.Month.ToString())) { row["LGRQ"] = buyDate.ToString("yyyy-MM-dd"); row["KPXE"] = this.GetInvUpLimit(invType); row["JH"] = Convert.ToString(num); row["LBDM"] = this._ListModel[num2].TypeCode; row["MC"] = ShareMethods.GetFPLBMC(this._ListModel[num2], this._dictFPLBBM); row["QSHM"] = ShareMethods.FPHMTo8Wei(this._ListModel[num2].HeadCode); row["SYZS"] = Convert.ToString(this._ListModel[num2].Number); uint num5 = (this._ListModel[num2].HeadCode + this._ListModel[num2].Number) - 1; row["JZZH"] = num5.ToString().PadLeft(8, '0'); row["LGZS"] = this._ListModel[num2].BuyNumber.ToString(); table.Rows.Add(row); } } num2++; num++; } this.customStyleDataGrid1.DataSource = table; } } } catch (BaseException exception) { this.loger.Error(exception.Message); ExceptionHandler.HandleError(exception); } catch (Exception exception2) { this.loger.Error(exception2.Message); ExceptionHandler.HandleError(exception2); } }