/// <summary> /// 双击查看明细列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvGoodsList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int rowIndex = e.RowIndex; if (rowIndex != -1) { SaleQueryCustomerModel saleInfo = dgvGoodsList.Rows[rowIndex].DataBoundItem as SaleQueryCustomerModel; if (saleInfo != null) { FrmSheetInfo fSheetInfo = new FrmSheetInfo(); //shType typeId id infoName fSheetInfo.Tag = new ShInfoModel() { ShType = 2, TypeId = 1, Id = saleInfo.UnitId, InfoName = saleInfo.UnitName }; TabControl tab = this.Parent.Parent as TabControl; if (FormUtility.CheckOpenForm(fSheetInfo.Name)) { tab.TabPages.RemoveByKey(fSheetInfo.Name); } tab.AddTabFormPage(fSheetInfo); tab.SelectedTab = tab.TabPages[fSheetInfo.Name]; } } }
/// <summary> /// 单元格双击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { Action act = () => { if (e.RowIndex >= 0) { SheetInfoModel sheetInfo = dgvList.Rows[e.RowIndex].DataBoundItem as SheetInfoModel; //行双击:打开单据编辑(查看)页面 //采购 销售 入库 shType 1 2 3 SheetFormParent frmInfo = null; //编辑页面 switch (sheetInfo.ShType) { case 1: frmInfo = new FrmPerchaseInStore(); break; case 2: frmInfo = new FrmSaleOutStore(); break; case 3: frmInfo = new FrmStartStockInfo(); break; } frmInfo.Tag = new FInfoModel() { ActType = 2, UName = uName, FId = sheetInfo.SheetId }; frmInfo.ReloadList += LoadSheetList; //订阅事件 TabControl tab = this.Parent.Parent as TabControl; if (FormUtility.CheckOpenForm(frmInfo.Name)) //如果已打开 { tab.TabPages.RemoveByKey(frmInfo.Name); FormUtility.CloseOpenForm(frmInfo.Name); } tab.AddTabFormPage(frmInfo); tab.SelectedTab = tab.TabPages[frmInfo.Name]; } }; 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]; } }