private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } billNum = path = string.Empty; if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("code1", StringComparison.OrdinalIgnoreCase)) { if (Authority.ProcessControText("配料单") == true) { if (IngredientTable == null || IngredientTable.IsDisposed) { IngredientTable = new FormBatchSheet(dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString()); IngredientTable.Show();//未打开,直接打开。 } else { IngredientTable.Activate();//已打开,获得焦点,置顶。 } } } else if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("code2", StringComparison.OrdinalIgnoreCase)) { if (Authority.ProcessControText("成品出库单") == true) { if (FinishedTable == null || FinishedTable.IsDisposed) { FinishedTable = new FormFinishedProductAssociation(dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString()); FinishedTable.Show();//未打开,直接打开。 } else { FinishedTable.Activate();//已打开,获得焦点,置顶。 } } } if (!string.IsNullOrEmpty(path)) { Reflected(path); } }
private void dataGridView1_CellClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } path = string.Empty; Megres.oddNum = string.Empty; if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("error", StringComparison.OrdinalIgnoreCase)) { if (Authority.ProcessControText("付款申请单") == true) { if (PaymentTabie == null || PaymentTabie.IsDisposed) { PaymentTabie = new FormPaymentTabie(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString(), "C"); PaymentTabie.Show();//未打开,直接打开。 } else { PaymentTabie.Activate();//已打开,获得焦点,置顶。 } } } else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("weight", StringComparison.OrdinalIgnoreCase)) { if (Authority.ProcessControText("进仓单") == true) { //自营仓库 if (BarnTable == null || BarnTable.IsDisposed) { BarnTable = new FormBarnAssociation(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString()); BarnTable.Show();//未打开,直接打开。 } else { BarnTable.Activate();//已打开,获得焦点,置顶。 } } } else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("coun1", StringComparison.OrdinalIgnoreCase)) { if (Authority.ProcessControText("入库申请单") == true) { FormWarehousingAssociation WarehousingTable = new FormWarehousingAssociation(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString()); WarehousingTable.ShowDialog(); //path = "FishClient.FormStorageOfRequisition"; //Megres . oddNum = dataGridView1 . Rows [ e . RowIndex ] . Cells [ "codeNumContract" ] . Value . ToString ( ); //Megres . fishId = dataGridView1 . Rows [ e . RowIndex ] . Cells [ "fishId" ] . Value . ToString ( ); } } else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("code2", StringComparison.OrdinalIgnoreCase)) { if (Authority.ProcessControText("配料单") == true) { FormIngredientAssociation IngredientTable = new FormIngredientAssociation(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString()); IngredientTable.ShowDialog(); } } else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("code3", StringComparison.OrdinalIgnoreCase)) //FormProcessStateForMacOne { if (Authority.ProcessControText("自定义标准表") == true) { path = "FishClient.FormCustomStandardTable"; Megres.oddNum = "1=1"; } } else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("code4", StringComparison.OrdinalIgnoreCase)) { if (Authority.ProcessControText("成品出库单") == true) { FormFinishedProductAssociation FinishedTable = new FormFinishedProductAssociation(dataGridView1.Rows[e.RowIndex].Cells["fishId"].Value.ToString()); FinishedTable.ShowDialog(); } } if (!string.IsNullOrEmpty(path)) { Reflected(path); } }