示例#1
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvItemStock.CurrentRow != null)
         {
             SetSortedColumns();
             frmItemStockEntry fItemStock = new frmItemStockEntry((int)Constant.Mode.Delete, Convert.ToInt64(dgvItemStock.CurrentRow.Cells["StockID"].Value));
             fItemStock.ShowDialog();
             setDefaultGridRecords(sender, e);
             btnDelete.Focus();
         }
     }
     catch (Exception exc)
     {
         Utill.Common.ExceptionLogger.writeException("ItemStock", exc.StackTrace);
         MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception");
     }
 }
示例#2
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            try
            {
                frmItemStockEntry fItemStock = new frmItemStockEntry((int)Constant.Mode.Insert, 0);
                fItemStock.ShowDialog();
                LoadList();

                DV           = dtblItemStock.DefaultView;
                DV.RowFilter = StrFilter;

                dgvItemStock.DataSource = DV.ToTable();
                lblTotRec.Text          = Utill.Common.CommonMessage.TotalRecord + dgvItemStock.RowCount.ToString();
                dgvItemStock_SelectionChanged(sender, e);
                PaintCell();
            }
            catch (Exception exc)
            {
                Utill.Common.ExceptionLogger.writeException("ItemStock", exc.StackTrace);
                MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception");
            }
        }