private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         PurchaseRequestStockDetailUI loPurchaseRequestStockDetail = new PurchaseRequestStockDetailUI();
         loPurchaseRequestStockDetail.ParentList = this;
         loPurchaseRequestStockDetail.ShowDialog();
     }
     catch { }
 }
 private void btnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         PurchaseRequestStockDetailUI loPurchaseRequestStockDetail = new PurchaseRequestStockDetailUI(
             dgvDetail.CurrentRow.Cells["Id"].Value.ToString(),
             dgvDetail.CurrentRow.Cells["StockId"].Value.ToString(),
             dgvDetail.CurrentRow.Cells["LocationId"].Value.ToString(),
             decimal.Parse(dgvDetail.CurrentRow.Cells["Qty"].Value.ToString()),
             decimal.Parse(dgvDetail.CurrentRow.Cells["UnitPrice"].Value.ToString()),
             decimal.Parse(dgvDetail.CurrentRow.Cells["TotalPrice"].Value.ToString()),
             dgvDetail.CurrentRow.Cells["Remarks"].Value.ToString());
         loPurchaseRequestStockDetail.ParentList = this;
         loPurchaseRequestStockDetail.ShowDialog();
     }
     catch (Exception ex)
     {
         ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnEdit_Click");
         em.ShowDialog();
         return;
     }
 }