private void btnAdd_Click(object sender, EventArgs e) { Cursor = Cursors.AppStarting; Form fx = new frmPurchaseInvoiceEntry(); fx.ShowDialog(); btnRefresh.PerformClick(); Cursor = Cursors.Default; }
private void btnEdit_Click(object sender, EventArgs e) { Cursor = Cursors.AppStarting; try { Form fx = new frmPurchaseInvoiceEntry((int)_grid.Columns["id"].Value); fx.ShowDialog(); btnRefresh.PerformClick(); } catch { RibbonMessageBox.Show("No data selected for editing\n", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } Cursor = Cursors.Default; }
private void btnDelete_Click(object sender, EventArgs e) { try { if (dgvPurchaseInvoice.CurrentRow != null) { SetSortedColumns(); frmPurchaseInvoiceEntry fPurchaseInvoice = new frmPurchaseInvoiceEntry((int)Constant.Mode.Delete, Convert.ToInt64(dgvPurchaseInvoice.CurrentRow.Cells["PIID"].Value)); fPurchaseInvoice.ShowDialog(); setDefaultGridRecords(sender, e); btnDelete.Focus(); } } catch (Exception exc) { Utill.Common.ExceptionLogger.writeException("PurchaseInvoice", exc.StackTrace); MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception"); } }
private void btnNew_Click(object sender, EventArgs e) { try { frmPurchaseInvoiceEntry fPurchaseInvoice = new frmPurchaseInvoiceEntry((int)Constant.Mode.Insert, 0); fPurchaseInvoice.ShowDialog(); LoadList(); DV = dtblPurchaseInvoice.DefaultView; DV.RowFilter = StrFilter; dgvPurchaseInvoice.DataSource = DV.ToTable(); lblTotRec.Text = Utill.Common.CommonMessage.TotalRecord + dgvPurchaseInvoice.RowCount.ToString(); } catch (Exception exc) { Utill.Common.ExceptionLogger.writeException("PurchaseInvoice", exc.StackTrace); MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception"); } }