public frmCusSettle() { InitializeComponent(); // Helper.GlobalData.InitForm(this); // var tb = new DataTable(); tb.Columns.Add("select_flag"); tb.Columns.Add("path"); tb.Columns.Add("voucher_no"); tb.Columns.Add("voucher_first"); tb.Columns.Add("sheet_amount", typeof(decimal)); tb.Columns.Add("paid_amount", typeof(decimal)); tb.Columns.Add("paid_free", typeof(decimal)); tb.Columns.Add("yf_amount", typeof(decimal)); tb.Columns.Add("pay_amount", typeof(decimal)); tb.Columns.Add("pay_free", typeof(decimal)); tb.Columns.Add("pay_date", typeof(DateTime)); tb.Columns.Add("memo"); tb.Columns.Add("voucher_type"); editGrid1.AddColumn("select_flag", "核销", "", 50, 2, "", false); editGrid1.AddColumn("path", "方向", "", 50, 2, "{-1:-,1:+}", false); editGrid1.AddColumn("voucher_no", "业务单号", "", 150, 1, "", false); editGrid1.AddColumn("voucher_first", "业务类型", "", 90, 2, IvyTransFunction.tran_no_str, false); editGrid1.AddColumn("sheet_amount", "单据金额", "", 100, 3, "0.00", false); editGrid1.AddColumn("paid_amount", "已付金额", "", 100, 3, "0.00", false); editGrid1.AddColumn("paid_free", "已免付金额", "", 100, 3, "0.00", false); editGrid1.AddColumn("yf_amount", "应付金额", "", 100, 3, "0.00", false); editGrid1.AddColumn("pay_amount", "本次付款金额", "", 120, 3, "0.00", true); editGrid1.AddColumn("pay_free", "免付金额", "", 100, 3, "0.00", true); editGrid1.AddColumn("pay_date", "限付日期", "", 100, 3, "yyyy-MM-dd", false); editGrid1.AddColumn("memo", "备注", "", 180, 1, "", true); editGrid1.AddColumn("voucher_type", "业务描述", "", 100, 1, "", false); editGrid1.SetTotalColumn("pay_amount,pay_free"); editGrid1.DataSource = tb; editGrid1.BindCheck("select_flag"); // try { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; // System.Threading.Thread th = new System.Threading.Thread(() => { Cursor.Current = Cursors.WaitCursor; Helper.GlobalData.windows.ShowLoad(this); try { BLL.CusFY bll = new BLL.CusFY(); var cus = bll.GetCusList(); this.txtcus.Invoke((MethodInvoker) delegate { this.txtcus.Bind(cus, 300, 200, "supcust_no", "supcust_no:客户编码:100,sup_name:客户名称:150", "supcust_no/sup_name->Text"); }); IBLL.IPayment paymentBLL = new BLL.PaymentBLL(); var pay_way = paymentBLL.GetAllList(); this.txtpay_way.Invoke((MethodInvoker) delegate { txtpay_way.Bind(pay_way, 300, 200, "pay_way", "pay_way:付款代码:100,pay_name:付款方式:100", "pay_way/pay_name->Text"); txtpay_way.GetDefaultValue(); }); var visa = bll.GetBankList(); this.txtvisa.Invoke((MethodInvoker) delegate { txtvisa.Bind(visa, 300, 200, "visa_id", "visa_id:编号:100,visa_nm:名称:130", "visa_id/visa_nm->Text"); txtvisa.GetDefaultValue(); }); var branch = bll.GetBranchList(); this.txtbranch.Invoke((MethodInvoker) delegate { txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text"); }); IBLL.IPeople peopleBLL = new BLL.PeopleBLL(); int tmp; var people = peopleBLL.GetDataTable("", "", 1, 1, 20000, out tmp); this.txtpeople.Invoke((MethodInvoker) delegate { txtpeople.Bind(people, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text"); txtpeople.GetDefaultValue(); }); this.Invoke((MethodInvoker) delegate { IOrder ins = this; ins.Add(); }); } catch (Exception ex) { IvyBack.Helper.LogHelper.writeLog("frmCusSettle", ex.ToString()); MsgForm.ShowFrom(ex); } Cursor.Current = Cursors.Default; Helper.GlobalData.windows.CloseLoad(this); }); th.Start(); } catch (Exception ex) { MsgForm.ShowFrom(ex); } finally { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; } }
public frmCusFY() { InitializeComponent(); // Helper.GlobalData.InitForm(this); // var tb = new DataTable(); tb.Columns.Add("kk_no"); tb.Columns.Add("kk_name"); tb.Columns.Add("kk_cash"); tb.Columns.Add("pay_kind"); tb.Columns.Add("other1"); editGrid1.AddColumn("kk_no", "费用代码", "", 90, 1, "", true); editGrid1.AddColumn("kk_name", "费用名称", "", 140, 1, "", false); editGrid1.AddColumn("kk_cash", "费用(金额)", "", 100, 3, "0.00", true); editGrid1.AddColumn("pay_kind", "应收增减", "", 75, 2, "{0:-,1:+}", false); editGrid1.AddColumn("other1", "备注", "", 250, 1, "", true); editGrid1.DataSource = tb; // try { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; // Thread th = new Thread(() => { Cursor.Current = Cursors.WaitCursor; Helper.GlobalData.windows.ShowLoad(this); try { BLL.CusFY bll = new BLL.CusFY(); var editgrid = bll.GetSZList(); this.editGrid1.Invoke((MethodInvoker) delegate { var edgrid = editgrid.Copy(); foreach (DataRow dr in edgrid.Rows) { dr["pay_kind"] = dr["pay_kind"].ToInt32() == 0 ? "-" : "+"; } editGrid1.Bind("kk_no", edgrid, 400, 200, "pay_way", "pay_way:费用代码:80,pay_name:费用名称:150,pay_kind:方向:60", "pay_way->kk_no,pay_name->kk_name,pay_kind->pay_kind"); }); var cus = bll.GetCusList(); this.txtcus.Invoke((MethodInvoker) delegate { this.txtcus.Bind(cus, 300, 200, "supcust_no", "supcust_no:客户编码:100,sup_name:客户名称:150", "supcust_no/sup_name->Text"); }); var visa = bll.GetBankList(); this.txtvisa.Invoke((MethodInvoker) delegate { txtvisa.Bind(visa, 300, 200, "visa_id", "visa_id:编号:100,visa_nm:名称:130", "visa_id/visa_nm->Text"); txtvisa.GetDefaultValue(); }); var branch_tb = bll.GetBranchList(); this.txtbranch.Invoke((MethodInvoker) delegate { txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text"); }); IBLL.IPeople peopleBLL = new BLL.PeopleBLL(); int tmp; var people = peopleBLL.GetDataTable("", "", 1, 1, 20000, out tmp); this.txtpeople.Invoke((MethodInvoker) delegate { txtpeople.Bind(people, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text"); txtpeople.GetDefaultValue(); }); this.Invoke((MethodInvoker) delegate { IOrder ins = this; ins.Add(); }); } catch (Exception ex) { LogHelper.writeLog("frmCusFY", ex.ToString()); MsgForm.ShowFrom(ex); } Cursor.Current = Cursors.Default; Helper.GlobalData.windows.CloseLoad(this); }); th.Start(); } catch (Exception ex) { MsgForm.ShowFrom(ex); } finally { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; } }