private void LoadTv() { if (itemcls_lis != null && itemcls_lis.Count > 0) { this.itemcls_lis.Clear(); } this.tv.Nodes.Clear(); int cb_index = Conv.ToInt(cb.SelectedValue); TreeNode tn = new TreeNode("所有"); if (cb_index == 1) { tn = new TreeNode("所有类别"); IBLL.IItemCls bll = new BLL.ItemClsBLL(); itemcls_lis = bll.GetAllList(); } else if (cb_index == 2) { tn = new TreeNode("所有货商"); IBLL.ISup bll = new BLL.SupBLL(); int tmp; var tb = bll.GetDataTable("", "", 1, 1, 20000, out tmp); sup_lis = new List <bi_t_supcust_info>(); foreach (DataRow row in tb.Rows) { Model.bi_t_supcust_info it = DB.ReflectionHelper.DataRowToModel <Model.bi_t_supcust_info>(row); sup_lis.Add(it); } } else if (cb_index == 3) { tn = new TreeNode("所有品牌"); } else if (cb_index == 4) { tn = new TreeNode("所有属性"); } tn.Tag = ""; this.tv.Nodes.Add(tn); LoadTreeView(); // this.tv.Nodes[0].Expand(); }
private void LoadSup() { if (!MyLove.PermissionsBalidation(this.Text, "18")) { return; } page.PageSize = this.dgvSup.MaxDisplayRowCount(); Thread th = new Thread(() => { Helper.GlobalData.windows.ShowLoad(this); try { Cursor.Current = Cursors.WaitCursor; string cls_no = ""; this.tv.Invoke((MethodInvoker) delegate { if (this.tv.SelectedNode != null) { if (this.tv.SelectedNode.Tag != null) { var item = (Model.bi_t_region_info) this.tv.SelectedNode.Tag; cls_no = item.region_no; } } }); string SelectedNode = ""; string Keyword = ""; int ShowStopSup = 0; this.Invoke((MethodInvoker) delegate { SelectedNode = this.tv.SelectedNode == null ? "" : cls_no; Keyword = this.txtKeyword.Text.Trim(); ShowStopSup = this.cbShowStopSup.Checked ? 1 : 0; }); if (_runType == 0) { IBLL.ISup bll = new BLL.SupBLL(); page = bll.GetDataTable( SelectedNode, Keyword, ShowStopSup, page ); } else if (_runType == 1) { IBLL.ICus bll = new BLL.CusBLL(); page = bll.GetDataTable( SelectedNode, Keyword, ShowStopSup, page ); } Conv.AddColorTable(page.tb, "display_flag"); this.Invoke((MethodInvoker) delegate { this.dgvSup.DataSource = page.tb; this.lblMaxIndex.Text = page.PageMax.ToString(); this.lblIndex.Text = page.PageIndex.ToString(); }); Cursor.Current = Cursors.Default; } catch (Exception ex) { LogHelper.writeLog("LoadSup", "获取商品分类出错!"); MsgForm.ShowFrom(ex); } Helper.GlobalData.windows.CloseLoad(this); }); th.Start(); }
private void LoadCb() { Thread th = new Thread(() => { Helper.GlobalData.windows.ShowLoad(this); Cursor.Current = Cursors.WaitCursor; try { //商品分类 IBLL.IItemCls bll = new BLL.ItemClsBLL(); tb_item_cls = bll.GetDataTable(); this.txtItemCls.Invoke((MethodInvoker) delegate { this.txtItemCls.Bind(tb_item_cls, 300, 200, "item_clsno", "item_clsno:编号:100,item_clsname:分类:150", "item_clsno/item_clsname->Text"); }); //单位 List <string> unit_lis = new List <string>() { "kg", "g", "包", "箱", }; this.cbUnitNo.Invoke((MethodInvoker) delegate { foreach (var key in unit_lis) { this.cbUnitNo.Items.Add(key); this.cbCGUnitNo.Items.Add(key); } this.cbUnitNo.SelectedIndex = 0; this.cbCGUnitNo.SelectedIndex = 0; }); //商品性质0:普通商品 1:称重商品 2:条码秤商品 Dictionary <string, string> dic2 = new Dictionary <string, string>() { { "0", "普通商品" }, { "1", "称重商品" }, { "2", "条码秤商品" }, }; this.cbitem_flag.Invoke((MethodInvoker) delegate { this.cbitem_flag.DisplayMember = "Value"; this.cbitem_flag.ValueMember = "Key"; this.cbitem_flag.DataSource = new BindingSource(dic2, null); }); //供应商 IBLL.ISup supbll = new BLL.SupBLL(); int num; tb_sup = supbll.GetDataTable("", "", 1, 1, 99999, out num); this.txtSup.Invoke((MethodInvoker) delegate { this.txtSup.Bind(tb_sup, 300, 200, "supcust_no", "supcust_no:编号:100,sup_name:供应商:150", "supcust_no/sup_name->Text"); }); LoadItem(); } catch (Exception ex) { LogHelper.writeLog("SysSetting_Load", ex.ToString()); MsgForm.ShowFrom(ex); } Cursor.Current = Cursors.Default; Helper.GlobalData.windows.CloseLoad(this); }); th.Start(); }