private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         StockReceivingItemDetailUI loStockReceivingItemDetailUI = new StockReceivingItemDetailUI();
         loStockReceivingItemDetailUI.ParentList = this;
         loStockReceivingItemDetailUI.ShowDialog();
     }
     catch (Exception ex)
     {
         ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnAdd_Click");
         em.ShowDialog();
         return;
     }
 }
 private void btnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         StockReceivingItemDetailUI loStockReceivingItemDetailUI = new StockReceivingItemDetailUI(
             dgvDetail.CurrentRow.Cells["Id"].Value.ToString(),
             dgvDetail.CurrentRow.Cells["PODetailId"].Value.ToString(),
             dgvDetail.CurrentRow.Cells["StockId"].Value.ToString(),
             dgvDetail.CurrentRow.Cells["LocationId"].Value.ToString(),
             decimal.Parse(dgvDetail.CurrentRow.Cells["POQty"].Value.ToString()),
             decimal.Parse(dgvDetail.CurrentRow.Cells["QtyIn"].Value.ToString()),
             decimal.Parse(dgvDetail.CurrentRow.Cells["Variance"].Value.ToString()),
             dgvDetail.CurrentRow.Cells["Remarks"].Value.ToString());
         loStockReceivingItemDetailUI.ParentList = this;
         loStockReceivingItemDetailUI.ShowDialog();
     }
     catch (Exception ex)
     {
         ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnEdit_Click");
         em.ShowDialog();
         return;
     }
 }