Example #1
0
 private void CheckPaymentBtn_Click(object sender, EventArgs e)
 {
     try
     {
         if (aVendorPaymentRowGlobal["IsChecked"].ToString() == "0")
         {
             string CheckedBy     = SharedFunctions.ReturnLoggedUserName();
             string ChkDate       = DateTime.Now.ToShortDateString();
             string ChkTime       = DateTime.Now.ToShortTimeString();
             int    PaymentNumber = int.Parse(aVendorPaymentRowGlobal["PaymentNumber"].ToString());
             if (!VendorsPaymentsMgmt.UpdatePaymentToChecked(CheckedBy, ChkDate, ChkTime, PaymentNumber))
             {
                 throw new Exception(" IN [DB-ERROR-EditVendorPayment-CheckPaymentBtn_Click] ");
             }
             MessageBox.Show(MsgTxt.CheckedSuccesfullyTxt, MsgTxt.AddedSuccessfully, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.Close();
         }
         else
         {
             MessageBox.Show(MsgTxt.AlreadyCheckedTxt, MsgTxt.WarningCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
             return;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditVendorPayment-CheckPaymentBtn_Click] \n Exception: \n" + ex.ToString() + "\n" + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
         this.Close();
     }
 }