//现有库存 private void btnStockList_Click(object sender, EventArgs e) { var db = new BathDBDataContext(LogIn.connectionString); string pro = ((Button)sender).Text; if (!BathClass.getAuthority(db, LogIn.m_User, pro)) { GeneralClass.printErrorMsg("权限不够,不能访问!"); return; } StorageForm storageForm = new StorageForm(); storageForm.ShowDialog(); }
//构造函数 public GoodsForm(BathDBDataContext dc, StorageList goods, StorageForm form) { db = dc; m_form = form; if (goods != null) { newGoods = false; m_goods = goods; } InitializeComponent(); catId.Items.AddRange(db.GoodsCat.Select(x => x.name).ToArray()); provider.Items.AddRange(db.Provider.Select(x => x.name).ToArray()); stock.Items.AddRange(db.Stock.Select(x => x.name).ToArray()); ComboUnit.Items.AddRange(db.Unit.Select(x => x.name).ToArray()); }