using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Threading; using System.Collections; using System.Reflection; using CoreFS.CA06; namespace Core.StlMes.Client.Sale.UI.Balance.BalanceAccount { public partial class FrmBalanceInvoceMgtOrgList : Core.StlMes.Client.Sale.Common.FrmStyleBase.FrmUIBase { public FrmBalanceInvoceMgtOrgList() { InitializeComponent(); } private DataSet dsInvoice = new DataSet(); private DataSet dsInvoiceDetail = null; private DataSet dsInvoiceSeq = new DataSet(); private DataSet dsInvoiceList = new DataSet(); private void initDataSource() { dsInvoice = base.GetDataSetByColumnName(this.GetGrid1DataStruct(), null, GetColumnAndCaption()); this.ultraGrid1.DataSource = dsInvoice; dsInvoiceSeq = base.GetDataSetByColumnName(this.GetGrid2DataStruct(), null, GetColumnAndCaption()); this.ultraGrid2.DataSource = dsInvoiceSeq; //dsInvoiceList = base.GetDataSetByColumnName(this.GetGrid3DataStruct(), //null, GetColumnAndCaption()); //this.ultraGrid3.DataSource = dsInvoiceList; } private void HiddenColumn() { try { this.ultraGrid2.DisplayLayout.Bands[0].Columns[this.INVOICENO].Hidden = true; this.ultraGrid2.DisplayLayout.Bands[0].Columns[this.INVOICENO_SEQ].Hidden = true; this.ultraGrid1.DisplayLayout.Bands[0].Columns["REALINVOICENO"].Hidden = true; } catch { } } protected override List GetNumberColumn() { return new List(new string[] { "SEND_NUM", "MONEY", "WEIGHT", "QUANTITY", "ACT_WGT", "OUTSTOCKMNY", "TRANSMNY", "PRICE", "PRICE_ORG", "MONEY_ORG", }); } private Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Balance.SlmBalanceInfo slmBalanceInfo = null; private void FrmBalanceInvoceMgt_Load(object sender, EventArgs e) { // this.ultraExpandableGroupBox2.Visible = false; // this.dateTimePicker1.Value = System.DateTime.Now.AddMonths(-1); slmBalanceInfo = new Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Balance.SlmBalanceInfo(this.ob); initDataSource(); base.SetGridStyle(ref this.ultraGrid1,ref this.ultraGrid2); InitGrid(); HiddenColumn(); InitGridValue(); } private void SaveRealInvoiceNo() { this.ultraGrid1.UpdateData(); Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null; if (this.ultraGrid1.Rows.Count == 0) return; ugr = this.ultraGrid1.ActiveRow; if (ugr == null) { MessageBox.Show("请选择需要保存的行"); return; } if (!IsCanBeUpdateWithDifferentPerson(ugr.Cells["INVOICEPERSON_ORG"].Value.ToString())) return; string invoiceno = ugr.Cells["INVOICENO_ORG"].Value.ToString(); string realInvoiceNo = ugr.Cells["REALINVOICENO_ORG"].Value.ToString(); if (realInvoiceNo.Length > 30) { MessageBox.Show("发票号允许最大长度30"); return; } string errMsg = ""; this.slmBalanceInfo.UpdateRealInvoiceNoOrg(invoiceno, realInvoiceNo, CoreFS.SA06.CoreUserInfo.UserInfo .GetUserName(), out errMsg); if (errMsg.Length == 0) { MessageBox.Show("保存成功"); } } private void InitGrid() { System.Drawing.Color color = System.Drawing.Color.FromArgb(255, 255, 128); try { this.ultraGrid1.DisplayLayout.Bands[0].Columns["REALINVOICENO_ORG"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid1.DisplayLayout.Bands[0].Columns["REALINVOICENO_ORG"].CellAppearance.BackColor = base.GetEditColor(); this.ultraGrid1.DisplayLayout.Bands[0].Columns["REALINVOICENO"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; this.ultraGrid1.DisplayLayout.Bands[0].Columns["REALINVOICENO"].CellAppearance.BackColor = base.GetEditColor(); } catch { } } private void InitGridValue() { try { this.ultraGrid1.DisplayLayout.Bands[0].Columns["FST_DRAWEE_UNIT"].ValueList = GetFstDraWeeUnit(); } catch { } } private Infragistics.Win.ValueList GetFstDraWeeUnit() { Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList(); lit.ValueListItems.Add("120601", "N/A"); lit.ValueListItems.Add("120602", "/"); lit.ValueListItems.Add("120603", "天津钢管集团股份有限公司"); lit.ValueListItems.Add("120604", "天津钢管钢铁贸易有限公司"); lit.ValueListItems.Add("120605", "天津钢管国际贸易有限公司"); lit.ValueListItems.Add("120606", "合同结算单位"); return lit; } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": { this.Query(); break; } case "RollInv": { this.RollBackInvoiceNo(); break; } case "Exit": { this.Close(); break; } case "Save": { this.SaveRealInvoiceNo(); break; } case "PrintInvoice": { this.PrintInvoice(); break; } case "Credit": { this.Credit(); break; } case "Export": { Core.StlMes.Client.Sale.Util.UtilUltraGrid.ExportGridDataToExcel(this.Text, this.ultraGrid1); break; } case "AddTrans": { InvoiceSignalTransMoney(); break; } case "PrintDetail": { PrintDetail(); break; } } } private void QueryTransMny() { string sql = GetSqlForInvoice(this.dateTimePicker1.Value, this.dateTimePicker2.Value); DataSet ds = base.ExecuteReader(sql); //DataSet ds = this.slmBalanceInfo.GetInvoiceSlmBalanceTransMoney(this.dateTimePicker1.Value, // this.dateTimePicker2.Value); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) return; if (this.dsInvoice == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { } else { foreach (DataRow dr in ds.Tables[0].Rows) { DataSet dstemp = Core.StlMes.Client.Sale.Util.UtilDataSet.GetDataSetWithRowFilter (dsInvoice, "INVOICENO_ORG", dr["INVOICENO_ORG"].ToString()); try { if (dstemp.Tables[0].Rows.Count > 0) { dr.Delete(); } } catch { } } } ds.AcceptChanges(); ds.Tables[0].TableName = this.dsInvoice.Tables[0].TableName; this.dsInvoice.Merge(ds, false, System.Data.MissingSchemaAction.Ignore); this.dsInvoice.AcceptChanges(); // ClearGrid(); } private string GetSqlForInvoice(System.DateTime dtbegin, System.DateTime dtEnd) { string sql = @" select sum(case when a.money_type = '出库费' then a.money else 0 end) OUTSTOCKMNY, sum(case when a.money_type = '运费' then a.money else 0 end) TRANSMNY, max(money_type) money_type, sum(nvl(a.weight, 0)) weight, a.buyercode, a.buyername, a.inceptcorpcode, a.fst_drawee_unit, a.forecorpcode forecorpname, a.forecorpname forecorpcode, a.invoiceno_org, MAX(A.REALINVOICENO_ORG) REALINVOICENO_ORG, max(a.INVOICEPERSON_org) INVOICEPERSON_ORG, max(a.invoicedate_org) INVOICEDATE_ORG, b.customer_nm, b.sale_area_desc,min(a.Invoice_Sts) Invoice_Sts from slm_balance_transmoney a join slm_order_head b on a.ord_pk = b.ord_pk where 1=1 and a.Invoice_Sts = '0' and a.invoiceno_org is not null {0} group by a.buyercode, a.buyername, a.inceptcorpcode, a.fst_drawee_unit, a.forecorpcode, a.forecorpname, a.invoiceno_org, b.customer_nm, b.sale_area_desc "; string sqlCondition = Util.ConverObject.ConvertDateTimeValueToDbLanguage("invoicedate_org", dtbegin, dtEnd); sql = string.Format(sql, sqlCondition); return sql; } private void InvoiceSignalTransMoney() { DlgBox.DlgSelectInvoceTransMnyAndOutStockMny dlg = new Core.StlMes.Client.Sale.UI.Balance.DlgBox.DlgSelectInvoceTransMnyAndOutStockMny(this.ob); dlg._invocieFlag = "1"; dlg.ShowDialog(); ArrayList arpk = new ArrayList(); string errMsg = ""; if (dlg.DialogResult == DialogResult.OK) { arpk = dlg.Tranpk; if (arpk.Count == 0) return; this.slmBalanceInfo.MakeFirstInvoiceForTransMnyAndOutStockMoney(arpk, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg); if (errMsg.Length == 0) { Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功"); this.Query(); } } } /// /// 冲减 /// private void Credit() { //Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null; //Infragistics.Win.UltraWinGrid.UltraGridRow ugrc = null; //if (this.ultraGrid1.Rows.Count == 0) // return; //if (this.ultraGrid2.Rows.Count == 0) // return; //if (this.ultraGrid1.Rows.Count == 1) // this.ultraGrid1.Rows[0].Activated = true; //ugr = this.ultraGrid1.ActiveRow; //if (ugr == null) //{ // Util.MessageUtil.ShowTips("请选择需要保存的行"); // return; //} //if (this.ultraGrid5.Rows.Count == 0) // return; //if (this.ultraGrid5.Rows.Count == 1) // this.ultraGrid5.Rows[0].Activated = true; //ugrc = this.ultraGrid5.ActiveRow; //if (ugrc == null) //{ // Util.MessageUtil.ShowTips("请选择待冲减的行"); // return; //} //string invoiceno = ugr.Cells["INVOICENO_ORG"].Value.ToString(); //// "WEIGHT", //// "MONEY", //double money = Util.ConverObject.ConvertToDouble(ugr.Cells["MONEY_ORG"].Value); //double weight = Util.ConverObject.ConvertToDouble(ugr.Cells["WEIGHT"].Value); //double creditMny = Util.ConverObject.ConvertToDouble(ugrc.Cells["MONEY_ORG"].Value); //if (creditMny >= money) //{ // Util.MessageUtil.ShowError("冲减金额必须小于货款"); // return; //} //if (weight == 0) //{ // Util.MessageUtil.ShowError("只能冲减货款"); // return; //} //if (Util.MessageUtil.ShowYesNoAndQuestion("是否确定冲减结算单?") == DialogResult.No) return; //double dlivPrice = (money - creditMny) / weight; //ArrayList list = new ArrayList(); //string[] str = null; //string sub_seq = ugrc.Cells["SUB_SEQ"].Value.ToString(); //foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugrr in this.ultraGrid2.Rows) //{ // double seqmoney = dlivPrice * Util.ConverObject.ConvertToDouble(ugrr.Cells["WEIGHT"].Value); // str = new string[] { invoiceno, ugrr.Cells["INVOICENO_SEQ_ORG"].Value.ToString(), dlivPrice + "", // seqmoney +"",sub_seq}; // list.Add(str); //} //string errMsg = ""; //this.slmBalanceInfo.Credit(list, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(), out errMsg); //if (errMsg.Length == 0) //{ // Util.MessageUtil.ShowTips("操作成功"); //} //this.Query(); } private void Print() { string INVOICENO = "INVOICENO_ORG"; string errMsg = ""; List list = new List(); if (this.ultraGrid1.Rows.Count == 0) return; if (this.ultraGrid1.Rows.Count == 1) this.ultraGrid1.Rows[0].Selected = true; this.ultraGrid1.ActiveRow.Selected = true; String sqlCondition = ""; double money = 0; string isGreaterThanZero = "0"; // 打印包含货款和独立的出库费 or 运费,这里因为模板不一样不能一起连打 money = Core.StlMes.Client.Sale.Util.ConverObject.ConvertToDouble(this.ultraGrid1.Selected.Rows[0].Cells["MONEY_ORG"].Value); if (money != 0) { isGreaterThanZero = "0"; } else { isGreaterThanZero = "1"; } foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Selected.Rows) { money = Core.StlMes.Client.Sale.Util.ConverObject.ConvertToDouble(ugr.Cells["MONEY_ORG"].Value); if (money != 0) { if (isGreaterThanZero == "1") { Core.StlMes.Client.Sale.Util.MessageUtil.ShowError("单独运费和出库费不能和货款票一起打印"); return; } } else { if (isGreaterThanZero == "0") { Core.StlMes.Client.Sale.Util.MessageUtil.ShowError("单独运费和出库费不能和货款票一起打印"); return; } } sqlCondition += "\'" + ugr.Cells[INVOICENO].Value.ToString() + "\'" + ","; list.Add(ugr.Cells[INVOICENO].Value.ToString()); } string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepInvoiceTicketOrg.cpt&__bypagesize__=false" + "&invoiceno="; if (isGreaterThanZero == "1") { url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepInvoiceTransAndOutStockMnOrg.cpt&__bypagesize__=false" + "&invoiceno="; } sqlCondition = sqlCondition.Substring(1, sqlCondition.Length - 1); sqlCondition = sqlCondition.Substring(0, sqlCondition.Length - 2); url = url + sqlCondition; Core.StlMes.Client.SaleOrder.ReviewForm.FrmOrderRepExcel fBug = new Core.StlMes.Client.SaleOrder.ReviewForm.FrmOrderRepExcel(this.ob, url); fBug.AutoSize = true; fBug.Text = "打印结算单"; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Show(); } private void PrintDetail() { string INVOICENO = "INVOICENO_ORG"; string errMsg = ""; List list = new List(); if (this.ultraGrid1.Rows.Count == 0) return; if (this.ultraGrid1.Rows.Count == 1) this.ultraGrid1.Rows[0].Selected = true; this.ultraGrid1.ActiveRow.Selected = true; String sqlCondition = ""; double money = 0; foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Selected.Rows) { sqlCondition += "\'" + ugr.Cells[INVOICENO].Value.ToString() + "\'" + ","; list.Add(ugr.Cells[INVOICENO].Value.ToString()); } string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepInvoiceTicketOrgAtta.cpt&__bypagesize__=false" + "&invoiceno="; sqlCondition = sqlCondition.Substring(1, sqlCondition.Length - 1); sqlCondition = sqlCondition.Substring(0, sqlCondition.Length - 2); url = url + sqlCondition; Core.StlMes.Client.SaleOrder.ReviewForm.FrmOrderRepExcel fBug = new Core.StlMes.Client.SaleOrder.ReviewForm.FrmOrderRepExcel(this.ob, url); fBug.AutoSize = true; fBug.Text = "打印结算单明细"; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Show(); } private void PrintInvoice() { Print(); return; string INVOICENO = "INVOICENO_ORG"; List list = new List(); if (this.ultraGrid1.Rows.Count == 0) return; if (this.ultraGrid1.Rows.Count == 1) this.ultraGrid1.Rows[0].Selected = true; this.ultraGrid1.ActiveRow.Selected = true; foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Selected.Rows) { list.Add(ugr.Cells[INVOICENO].Value.ToString()); } DlgInvoicePrint print = null; print = new DlgInvoicePrint(this.ob); print.listInvoiceNo = list; print.isOrgInvoice = true; print.ShowDialog(); } private DataSet GetTransMnyByInvoiceNo(string invoiceno) { string sql = @"select sum(a.money) money,sum(a.weight) weight,a.money_type,a.invoiceno_org from slm_balance_transmoney a where invoiceno_org = '{0}' and a.invoiceno_org is not null group by a.money_type,a.invoiceno_org"; sql = string.Format(sql, invoiceno); DataSet ds = base.ExecuteReader(sql); return ds; } private void SetTransMoneyAndOutStockMoney() { if (this.dsInvoice == null || this.dsInvoice.Tables.Count == 0 || this.dsInvoice.Tables[0].Rows.Count == 0) return; foreach (DataRow dri in this.dsInvoice.Tables[0].Rows) { try { string invoiceno = dri[this.INVOICENO].ToString(); DataSet ds = GetTransMnyByInvoiceNo(invoiceno); //DataSet ds = this.slmBalanceInfo.GetInvoiceSlmBalanceTransMoneyAndOutStockMoney(this.dateTimePicker1.Value, // this.dateTimePicker2.Value); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) continue; foreach (DataRow drd in ds.Tables[0].Rows) { if (drd["MONEY_TYPE"].ToString() == "运费") { dri["TRANSMNY"] = drd["MONEY"]; } if (drd["MONEY_TYPE"].ToString() == "出库费") { dri["OUTSTOCKMNY"] = drd["MONEY"]; } } } catch { } } this.dsInvoice.AcceptChanges(); ClearGrid(); } private Boolean IsCanBeUpdateWithDifferentPerson(string user) { if (user == CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName()) { return true; } else { Core.StlMes.Client.Sale.Util.MessageUtil.ShowError("只允许操作本人票据"); return false; } } private void RollBackInvoiceNo() { if (this.ultraGrid1.Rows.Count == 0) return; Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; if (!IsCanBeUpdateWithDifferentPerson(ugr.Cells["INVOICEPERSON_ORG"].Value.ToString())) return; string invoinceno = ugr.Cells[this.INVOICENO].Value.ToString(); this.slmBalanceInfo.RollBaskInvoiceNoOrg(invoinceno, CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName()); ugr.Delete(false); this.ultraGrid1.UpdateData(); } private string saleOrg_Corp = "120603"; private string saleOrg_Gm = "120604"; private string saleOrg_Gtm = "120605"; private void Query() { dsInvoiceDetail = this.slmBalanceInfo.GeOrgtInvoiceSlmBalaneInfoByInvoiceBeginDateAndEndDate(this.dateTimePicker1.Value, this.dateTimePicker2.Value); //if (this.textBox3.Text.Length > 0) //{ // dsInvoiceDetail = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(dsInvoiceDetail, "ORD_NO", this.textBox3.Text.Trim()); //} // 只显示首次受票单位为国贸,钢贸,集团的数据 try { dsInvoiceDetail = Util.UtilDataSet.GetDataSetWithRowFilter(dsInvoiceDetail, "FST_DRAWEE_UNIT", new string[] { saleOrg_Corp, saleOrg_Gm, saleOrg_Gtm } ); } catch { } dsInvoiceDetail = base.GetDataSetByFilterDeptId(dsInvoiceDetail); //if ("120504".Equals(CustomInfo)) dsInvoiceDetail = Util.UtilDataSet.GetDataSetWithRowFilter(dsInvoiceDetail, "supply_unit", CustomInfo); // 只显示未结转的 dsInvoiceDetail = Core.StlMes.Client.Sale.Util.UtilDataSet.GetDataSetWithRowFilter(dsInvoiceDetail, "INVOICE_STS", "0"); DataSet ds = Util.UtilDataSet.GetDateSetByGroupColumnAndStaticsColumnName(dsInvoiceDetail, new List(GetGroupByName()), new List(GetShowName()), new List(GetStaticName())); Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsInvoice, ds); SetTransMoneyAndOutStockMoney(); QueryTransMny(); ClearGrid(); } private void ClearGrid() { this.dsInvoiceSeq.Clear(); this.dsInvoiceList.Clear(); } private void QueryTransMny1() { DataSet ds = this.slmBalanceInfo.GetInvoiceSlmBalanceTransMoney(this.dateTimePicker1.Value, this.dateTimePicker2.Value); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) return; ds.Tables[0].TableName = this.dsInvoice.Tables[0].TableName; this.dsInvoice.Merge(ds); this.dsInvoice.AcceptChanges(); } private void QuryGrid2(string invoiceNo) { DataSet ds2 = Util.UtilDataSet.GetDataSetWithRowFilter(dsInvoiceDetail, this.INVOICENO, invoiceNo); DataSet ds = Util.UtilDataSet.GetDateSetByGroupColumnAndStaticsColumnName(ds2, new List(this.GetGrid2GroupByCol()), new List(this.GetGrid2ShowCol()), new List(this.GetGrid2StaticCol())); Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsInvoiceSeq, ds); } private void QueryGrid3(String invoiceno, string invoiceno_seq) { DataSet ds2 = Util.UtilDataSet.GetDataSetWithRowFilter(dsInvoiceDetail, this.INVOICENO, invoiceno); DataSet ds3 = Util.UtilDataSet.GetDataSetWithRowFilter(ds2, this.INVOICENO_SEQ, invoiceno_seq); Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsInvoiceList, ds3); } private string[] GetGroupByName() { return new string[] { "INVOICENO_ORG", // "FST_DRAWEE_UNIT", // "BUYERNAME", "FORECORPCODE" // "ORD_NO" }; } private string[] GetShowName() { return new string[] { //"REMARK" , // "PRICE_ORG", "REALINVOICENO_ORG", "INVOICEPERSON_ORG", "INVOICEDATE_ORG", "FST_DRAWEE_UNIT","REALINVOICENO_DATE_ORG" }; } private string[] GetStaticName() { return new string[] { "WEIGHT", "MONEY_ORG" }; } private string[] GetGrid1DataStruct() { return new string[] { "INVOICENO_ORG", "REALINVOICENO_ORG", // "REALINVOICENO_DATE_ORG", "FST_DRAWEE_UNIT", // "REALINVOICENO", // "BUYERNAME", "WEIGHT", "MONEY_ORG", "TRANSMNY", "OUTSTOCKMNY", // "TRANSMONEYQC", //"TRANSMONEYSY1", //"TRANSMONETRAIN", // "HOISTINGFEE", // "ORD_NO", // "REMARK", "FORECORPCODE", "INVOICEPERSON_ORG", "INVOICEDATE_ORG" } ; } private Hashtable GetColumnAndCaption() { return StaticData.TbColumnAndCaption.GetColumnAndCaption(); Hashtable hs = new Hashtable(); hs.Add("WEIGHT", "重量"); hs.Add("INVOICENO", "结算单号"); hs.Add("FORECORPCODE", "子公司"); hs.Add("SHIPNO", "船号"); hs.Add("TRANSMONEYQC", "汽运费"); hs.Add("TRANSMONEYSY1", "船运费"); hs.Add("TRANSMONETRAIN", "火运费"); hs.Add("HOISTINGFEE", "吊装费"); hs.Add("PLY", "厚/直径/壁厚"); hs.Add("WIDTH", "宽/外径"); hs.Add("ORD_NO", "合同号"); hs.Add("BUYERNAME", "结算单位名称"); hs.Add("BUYERCODE", "结算单位名称"); hs.Add("FST_DRAWEE_UNIT", "首次受票人"); hs.Add("STATIONCODE", "到站"); hs.Add("MONEY_ORG", "金额"); hs.Add("PRICE_ORG", "单价"); hs.Add("INVOICENO_ORG", "结算单号"); hs.Add("INVOICENO_SEQ_ORG", "序号"); hs.Add("INVOICEPERSON_ORG", "编单人"); hs.Add("INVOICENO_SEQ_ORG", "编单时间"); return hs; } protected override Hashtable GetGridColumnLength() { return StaticData.TbColumnAndCaption.GetDataSetColumnLength(); } private string[] GetGrid5DataStruct() { return new string[] { "SUBTCT_TYP", "SUBTCT_MOD", "SUBTCT_MNY", "SUBTCT_DSP", "DCL_ID", "DCL_DTIME", "REV_ID", "REV_DTIME", "REV_DSP" } ; } private string[] GetGrid2DataStruct() { return new string[] { "INVOICENO_ORG", "INVOICENO_SEQ_ORG", "ORD_NO", "ORD_SEQ", "PRICE_ORG", "WEIGHT", "MONEY_ORG", "SPETKEY", "STEELCODEKEY", "CATEGORY", "SPEC_ABBSYMNAME", "STD_STYLE_DESC", "MODEL_DESC", "ASKPLAN_ID" } ; } private string[] GetGrid2GroupByCol() { return new string[] { "INVOICENO_ORG", "INVOICENO_SEQ_ORG", "ASKPLAN_ID" }; } private string[] GetGrid2ShowCol() { return GetGrid2DataStruct(); } private string[] GetGrid2StaticCol() { return new string[] { "WEIGHT", "MONEY_ORG" }; } private string[] GetGrid3DataStruct() { return new string[] { "SPETKEY", "STEELCODEKEY", "QUANTITY", "WEIGHT", "MONEY_ORG", "TRAINWAGON", // "SHIPNO", // "DOCKCODE", "STATIONCODE", } ; } private string[] GetGrid4DataStruct() { return new string[] { "SUBTCT_TYP", "SUBTCT_MOD", "SUBTCT_MNY", "SUBTCT_DSP", "SUBTCT_TIME" } ; } private string BUYERCODE = "BUYERCODE"; private string ORD_NO = "ORD_NO"; private string ORD_SEQ = "ORD_SEQ"; private string ORD_LN_DLY = "ORD_LN_DLY"; private string ASKPLAN_ID = "ASKPLAN_ID"; private string ASKPLAN_ID_SEQ = "ASKPLAN_ID_SEQ"; private string SPETKEY = "SPETKEY"; private string STEELCODEKEY = "STEELCODEKEY"; private string MONEY = "MONEY_ORG"; private string WEIGHT = "WEIGHT"; private string PRICE = "PRICE_ORG"; private string BALANCESTATUS = "BALANCESTATUS"; private string ADJUSTPRICEREASON = "ADJUSTPRICEREASON"; private string INVOICENO = "INVOICENO_ORG"; private string INVOICENO_SEQ = "INVOICENO_SEQ_ORG"; private string BALANCESTATUS_INIT = "0"; private string BALANCESTATUS_AFFRIM = "1"; private string BALANCESTATUS_INVOINCE = "2"; private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { if (this.ultraGrid1.Rows.Count == 0) return; Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null; if (this.ultraGrid1.Rows.Count == 1) ugr = this.ultraGrid1.Rows[0]; else ugr = this.ultraGrid1.ActiveRow; string invoiceno = ugr.Cells[this.INVOICENO].Value.ToString(); this.QuryGrid2(invoiceno); } private void ultraGrid2_AfterRowActivate(object sender, EventArgs e) { if (this.ultraGrid2.Rows.Count == 0) return; Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null; if (this.ultraGrid2.Rows.Count == 1) ugr = this.ultraGrid2.Rows[0]; else ugr = this.ultraGrid2.ActiveRow; string invoiceno = ugr.Cells[this.INVOICENO].Value.ToString(); string invoicenoseq = ugr.Cells[this.INVOICENO_SEQ].Value.ToString(); this.QueryGrid3(invoiceno, invoicenoseq); } private void button3_Click(object sender, EventArgs e) { this.PrintInvoice(); } private void ultraGrid1_AfterRowActivate_1(object sender, EventArgs e) { if (this.ultraGrid1.Rows.Count == 0) return; Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null; if (this.ultraGrid1.Rows.Count == 1) ugr = this.ultraGrid1.Rows[0]; else ugr = this.ultraGrid1.ActiveRow; string invoiceno = ugr.Cells[this.INVOICENO].Value.ToString(); this.QuryGrid2(invoiceno); } private void ultraGrid2_AfterRowActivate_1(object sender, EventArgs e) { if (this.ultraGrid2.Rows.Count == 0) return; Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null; if (this.ultraGrid2.Rows.Count == 1) ugr = this.ultraGrid2.Rows[0]; else ugr = this.ultraGrid2.ActiveRow; string invoiceno = ugr.Cells[this.INVOICENO].Value.ToString(); string invoicenoseq = ugr.Cells[this.INVOICENO_SEQ].Value.ToString(); this.QueryGrid3(invoiceno, invoicenoseq); } } }