private void tsbDel_Click(object sender, EventArgs e) { try { if (!MyLove.PermissionsBalidation(this.Text, "02")) { return; } if (tvItemCls.SelectedNode != null) { if (YesNoForm.ShowFrom("确认要删除吗?") == DialogResult.Yes) { IBLL.IItemCls bll = new BLL.ItemClsBLL(); bll.Del(tvItemCls.SelectedNode.Tag as bi_t_item_cls); tvItemCls.SelectedNode.Remove(); } } } catch (Exception ex) { LogHelper.writeLog("ItemCls=>Del", ex.ToString()); MsgForm.ShowFrom(ex); } }
private void myButtonOk_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(this.txtItemCls.Text)) { this.txtItemCls.Focus(); MsgForm.ShowFrom("请输入名称!"); return; } IBLL.IItemCls bll = new BLL.ItemClsBLL(); if (ord_itemcls == null || string.IsNullOrEmpty(ord_itemcls.item_clsno)) { bi_t_item_cls item = new bi_t_item_cls() { item_clsno = bll.GetMaxCode(par_code), item_flag = "0", item_clsname = this.txtItemCls.Text, display_flag = "1" }; bll.Add(item); } else { ord_itemcls.item_clsname = this.txtItemCls.Text; bll.Upload(ord_itemcls); } if (ord_itemcls != null) { this.Close(); } this.txtItemCls.Text = ""; this.txtItemCls.Focus(); } catch (Exception ex) { ord_itemcls = null; LogHelper.writeLog("ItemClsUpload=>Add", ex.ToString()); MsgForm.ShowFrom(ex); } }
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 frmStockInit_Load(object sender, EventArgs e) { try { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; // IBLL.ICommonBLL bll2 = new BLL.CommonBLL(); this.txtBranch.Bind(bll2.GetBranchList(), 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text"); IBLL.IItemCls clsbll = new BLL.ItemClsBLL(); this.txtItemCls.Bind(clsbll.GetDataTable(), 250, 200, "item_clsno", "item_clsno:分类编号:80,item_clsname:商品分类:170", "item_clsno/item_clsname->Text"); } catch (Exception ex) { MsgForm.ShowFrom(ex); Helper.LogHelper.writeLog("frmCGInSheet()", ex.ToString()); } finally { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; } }
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(); }
public void LoadItemCls() { try { Thread th = new Thread(() => { Helper.GlobalData.windows.ShowLoad(this); try { IBLL.IItemCls bll = new BLL.ItemClsBLL(); itemcls_lis = bll.GetAllList(); this.Invoke((MethodInvoker) delegate { Cursor.Current = Cursors.WaitCursor; string key = ""; if (this.tvItemCls.SelectedNode != null) { if (tvItemCls.SelectedNode.Tag != null) { var item = (Model.bi_t_item_cls)tvItemCls.SelectedNode.Tag; key = item.item_clsno; } } // this.tvItemCls.Nodes[0].Nodes.Clear(); LoadTreeView(); // if (key == "") { this.tvItemCls.SelectedNode = this.tvItemCls.Nodes[0]; this.tvItemCls.SelectedNode.Expand(); } else { foreach (TreeNode n in GetNodes(this.tvItemCls.Nodes[0])) { var item = (Model.bi_t_item_cls)n.Tag; if (key == item.item_clsno) { this.tvItemCls.SelectedNode = n; this.tvItemCls.SelectedNode.Expand(); break; } } } Cursor.Current = Cursors.Default; }); } catch (Exception ex) { LogHelper.writeLog("LoadItemCls", "获取商品分类出错!"); MsgForm.ShowFrom(ex); } Helper.GlobalData.windows.CloseLoad(this); }); th.Start(); } catch (Exception ex) { LogHelper.writeLog("LoadItemCls", "获取商品分类出错!"); MsgForm.ShowFrom(ex); } }