void dgrdv_CellContentClick(object sender, DataGridViewCellEventArgs e) { int irow = e.RowIndex; int icol = e.ColumnIndex; if ((irow == -1) || (icol == -1)) { return; } int FormatID = (int)this.dtblFormat.DefaultView[irow]["FormatID"]; if (this.dgrdv.Columns[icol].Name == this.ColumnBtnEdit.Name) { if (frmOper == null) { frmOper = new FrmSaleInvoiceFormatOper(); new FrmStyle(frmOper).SetPopFrmStyle(this); frmOper.AffterSave += new FrmSaleInvoiceFormatOper.AffterSaveDelegate(frmOper_AffterSave); } frmOper.EditFormat(FormatID); frmOper.ShowDialog(); } if (this.dgrdv.Columns[icol].Name == this.ColumnBtnCopy.Name) { if (frmCopy == null) { frmCopy = new FrmSaleInvoiceFormatCopy(); new FrmStyle(frmCopy).SetPopFrmStyle(this); frmCopy.AffterSave += this.LoadData; } frmCopy.NewFromCopy(FormatID); frmCopy.ShowDialog(); } }
void lnkNew_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (frmOper == null) { frmOper = new FrmSaleInvoiceFormatOper(); new FrmStyle(frmOper).SetPopFrmStyle(this); frmOper.AffterSave += new FrmSaleInvoiceFormatOper.AffterSaveDelegate(frmOper_AffterSave); } frmOper.NewFormat(); frmOper.ShowDialog(); }