List <StockChangeInfoModel> stockChangeList = null; //商品库存变动记录 private void FrmGoodsStockChangeList_Load(object sender, EventArgs e) { Action act = () => { if (this.Tag != null) { goodsStockInfo = this.Tag as StoreStockQueryModel; } if (goodsStockInfo != null) { initGoodsInfo(); //初始化商品信息 LoadGoodsStockChangeData(); //加载商品的库存变动记录 } }; act.TryCatch("加载商品库存查询异常!"); }
/// <summary> /// 双击行查看商品库存变动明细 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { StoreStockQueryModel model = dgvList.Rows[e.RowIndex].DataBoundItem as StoreStockQueryModel; FrmGoodsStockChangeList fGoodsChangeList = new FrmGoodsStockChangeList(); fGoodsChangeList.Tag = model; fGoodsChangeList.storeInfo = new StoreInfoModel() { StoreId = store == null ? 0 : store.StoreId, StoreName = txtInStore.Text.Trim() }; //打开方式 TabControl tab = this.Parent.Parent as TabControl; if (FormUtility.CheckOpenForm(fGoodsChangeList.Name)) { tab.TabPages.RemoveByKey(fGoodsChangeList.Name); } tab.AddTabFormPage(fGoodsChangeList); tab.SelectedTab = tab.TabPages[fGoodsChangeList.Name]; } }
/// <summary> /// 查看商品库存分布 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsbtnStoreDistribute_Click(object sender, EventArgs e) { Action act = () => { if (dgvList.CurrentRow != null) { StoreStockQueryModel model = dgvList.CurrentRow.DataBoundItem as StoreStockQueryModel; if (model != null) { FrmGoodsStockInfo fGoodsStock = new FrmGoodsStockInfo(); fGoodsStock.Tag = model; fGoodsStock.storeInfo = new StoreInfoModel() { StoreId = store == null ? 0 : store.StoreId, StoreName = txtInStore.Text.Trim() }; fGoodsStock.ShowDialog(); } } }; act.TryCatch("查看商品仓库分布出现异常!"); }