private void OK() { IBLL.IPeople bll = new BLL.PeopleBLL(); if (people == null || string.IsNullOrEmpty(people.oper_id)) { //添加 bi_t_people_info peo = new bi_t_people_info() { oper_id = txtOperId.Text, oper_name = txtOperName.Text, oper_status = cbStatus.SelectedValue.ToString(), birthday = dtpBirthday.Value, dept_no = cbDept.SelectedValue.ToString(), in_date = dtpIn.Value, tel = txtTel.Text, }; bll.Add(peo); } else { //修改 people.oper_name = txtOperName.Text; people.tel = txtTel.Text; people.birthday = dtpBirthday.Value; people.in_date = dtpIn.Value; people.oper_status = cbStatus.SelectedValue.ToString(); people.dept_no = cbDept.SelectedValue.ToString(); bll.Update(people); } }
private void LoadPeo() { if (!MyLove.PermissionsBalidation(this.Text, "18")) { return; } page.PageSize = this.dgvPeo.MaxDisplayRowCount(); string selectedNode = this.tv.SelectedNode == null ? "" : this.tv.SelectedNode.Tag.ToString(); string Keyword = this.txtKeyword.Text.Trim(); int ShowStopPeo = this.cbShowStopPeo.Checked ? 1 : 0; Thread th = new Thread(() => { Helper.GlobalData.windows.ShowLoad(this); try { IBLL.IPeople bll = new BLL.PeopleBLL(); page = bll.GetDataTable( selectedNode, Keyword, ShowStopPeo, page ); this.Invoke((MethodInvoker) delegate { Cursor.Current = Cursors.WaitCursor; Conv.AddColorTable(page.tb, "oper_status"); this.dgvPeo.DataSource = page.tb; this.lblMaxIndex.Text = page.PageMax.ToString(); this.lblIndex.Text = page.PageIndex.ToString(); Cursor.Current = Cursors.Default; }); } catch (Exception ex) { LogHelper.writeLog("LoadPeo", "获取员工出错!"); MsgForm.ShowFrom(ex); } Helper.GlobalData.windows.CloseLoad(this); }); th.Start(); }
private void tsbDel_Click(object sender, EventArgs e) { if (!MyLove.PermissionsBalidation(this.Text, "02")) { return; } DataRow dr = this.dgvPeo.CurrentRow(); if (dr == null) { return; } if (YesNoForm.ShowFrom("确认要删除吗?") == DialogResult.Yes) { IBLL.IPeople bll = new BLL.PeopleBLL(); var peo = DB.ReflectionHelper.DataRowToModel <bi_t_people_info>(dr); bll.Del(peo); LoadPeo(); } }
public frmCashOrder() { InitializeComponent(); Helper.GlobalData.InitForm(this); try { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; // Thread th = new Thread(() => { Helper.GlobalData.windows.ShowLoad(this); try { IBLL.IPayment paymentBLL = new BLL.PaymentBLL(); var pay_way_tb = paymentBLL.GetAllList(); this.txtpay_way.Invoke((MethodInvoker) delegate { this.txtpay_way.Bind(pay_way_tb, 300, 200, "pay_way", "pay_way:类型编码:100,pay_name:付款类型:150", "pay_way/pay_name->Text"); }); IBLL.IBank bankBLL = new BLL.BankBLL(); var bank_tb = bankBLL.GetAllList(); this.txtpay_way.Invoke((MethodInvoker) delegate { this.txtvisa.Bind(bank_tb, 300, 200, "visa_id", "visa_id:编号:100,visa_nm:名称:130", "visa_id/visa_nm->Text"); }); var bank_tb2 = bankBLL.GetAllList(); this.txtvisa2.Invoke((MethodInvoker) delegate { txtvisa2.Bind(bank_tb2, 300, 200, "visa_id", "visa_id:编号:100,visa_nm:名称:130", "visa_id/visa_nm->Text"); }); IBLL.IBranch branchBLL = new BLL.BranchBLL(); var branch_tb = branchBLL.GetAllList(4); 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_tb = peopleBLL.GetDataTable("", "", 1, 1, 20000, out tmp); this.txtpeople.Invoke((MethodInvoker) delegate { txtpeople.Bind(people_tb, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text"); }); this.Invoke((MethodInvoker) delegate { IOrder ins = this; ins.Add(); }); } catch (Exception ex) { LogHelper.writeLog("frmCashOrder", ex.ToString()); MsgForm.ShowFrom(ex); } Helper.GlobalData.windows.CloseLoad(this); Cursor.Current = Cursors.Default; }); th.Start(); } catch (Exception ex) { MsgForm.ShowFrom(ex); } finally { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; } }
public frmSupSettle() { 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.BindCheck("select_flag"); editGrid1.DataSource = tb; // 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.SupFY bll = new BLL.SupFY(); var sup = bll.GetSupList(); this.txtsup.Invoke((MethodInvoker) delegate { this.txtsup.Bind(sup, 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("frmSupSettle", 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; } }
private void LoadCb() { Thread th = new Thread(() => { Cursor.Current = Cursors.WaitCursor; Helper.GlobalData.windows.ShowLoad(this); try { IBLL.IRegion bll = new BLL.RegionBLL(); sup_tb = bll.GetDataTable(); IBLL.IPeople pbll = new BLL.PeopleBLL(); int count; peo_tb = pbll.GetDataTable("", "", 1, 1, 99999, out count); this.Invoke((MethodInvoker) delegate { //货商区域 this.txtRegion.Bind(sup_tb, 300, 200, "region_no", "region_no:编号:80,region_name:区域:150", "region_no/region_name->Text"); //货商分类 Dictionary <string, string> dic = new Dictionary <string, string>() { { "00", "不定" } }; this.cbSupType.DisplayMember = "Value"; this.cbSupType.ValueMember = "Key"; this.cbSupType.DataSource = new BindingSource(dic, null); //业务员 this.txtPeo.Bind(peo_tb, 250, 200, "oper_id", "oper_id:编号:80,oper_name:名字:150", "oper_id/oper_name->Text"); //价格等级 Dictionary <string, string> dic3 = new Dictionary <string, string>() { { "1", "一级批发价" }, { "2", "二级批发价" }, { "3", "三级批发价" }, }; this.cbPriceLevel.DisplayMember = "Value"; this.cbPriceLevel.ValueMember = "Key"; this.cbPriceLevel.DataSource = new BindingSource(dic3, null); //客户组 IBLL.ISupcustGroup gbll = new BLL.SupcustGroupBLL(); DataTable flag = new DataTable(); if (_runType == 0) { flag = gbll.GetSupGroup(); } else if (_runType == 1) { flag = gbll.GetCusGroup(); } if (flag.Columns.Count < 1) { flag = Conv.Assign <bi_t_supcust_group>(); } DataRow dr = flag.NewRow(); dr["SupCust_GroupNo"] = "0"; dr["SupCust_GroupName"] = "不定"; flag.Rows.InsertAt(dr, 0); this.cb_supcust_group.DisplayMember = "SupCust_GroupName"; this.cb_supcust_group.ValueMember = "SupCust_GroupNo"; this.cb_supcust_group.DataSource = flag; LoadSup(); }); } catch (Exception ex) { LogHelper.writeLog("LoadCb", ex.ToString()); MsgForm.ShowFrom(ex); } Cursor.Current = Cursors.Default; Helper.GlobalData.windows.CloseLoad(this); }); th.Start(); }
private void LoadItem() { string keyword = this.txtKeyword.Text.Trim(); DataTable dt = new DataTable(); if (this.op_type == "1") { //商品 IBLL.IItem bll = new BLL.ItemBLL(); dt = bll.QuickSearchList(keyword); if (dt.Rows.Count == 0) { } else if (dt.Rows.Count == 1) { this.item_no = dt.Rows[0]["item_subno"].ToString(); DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } else if (this.op_type == "2") { //客户 IBLL.ICus bll = new BLL.CusBLL(); dt = bll.QuickSearchList(keyword); if (dt.Rows.Count == 1) { this.item_no = dt.Rows[0]["supcust_no"].ToString(); DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } else if (this.op_type == "3") { //供应商 IBLL.ISup bll = new BLL.SupBLL(); dt = bll.QuickSearchList(keyword); if (dt.Rows.Count == 1) { this.item_no = dt.Rows[0]["supcust_no"].ToString(); DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } else if (this.op_type == "4") { //业务员 IBLL.IPeople bll = new BLL.PeopleBLL(); dt = bll.QuickSearchList("02", keyword); if (dt.Rows.Count == 1) { this.item_no = dt.Rows[0]["oper_id"].ToString(); DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } else if (this.op_type == "5") { //仓库 IBLL.IBranch bll = new BLL.BranchBLL(); dt = bll.QuickSearchList(keyword); if (dt.Rows.Count == 1) { this.item_no = dt.Rows[0]["branch_no"].ToString(); DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } this.dgvItem.DataSource = dt; if (dt.Rows.Count > 0) { this.dgvItem.Focus(); } else { this.txtKeyword.Focus(); } }
public frmSupFY() { 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; // System.Threading.Thread th = new System.Threading.Thread(() => { Cursor.Current = Cursors.WaitCursor; Helper.GlobalData.windows.ShowLoad(this); try { BLL.SupFY bll = new BLL.SupFY(); 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.GetSupList(); 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 = 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("frmSupFY", 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; } }