예제 #1
0
 protected void btndelete_Click(object sender, EventArgs e)
 {
     try
     {
         ArrayList arrList = new ArrayList();
         for (int i = 0; i < grdMakeInvoicePayment.Items.Count; i++)
         {
             CheckBox chk = (CheckBox)grdMakeInvoicePayment.Items[i].FindControl("chkRemove");
             if (chk.Checked)
             {
                 string Id = grdMakeInvoicePayment.Items[i].Cells[9].Text;
                 arrList.Add(Id);
             }
         }
         Employer objEmployer = new Employer();
         int      iReturn     = objEmployer.DeletePayment(arrList, txtCompanyID.Text, hdninvoicenumber.Value);
         if (iReturn != 0)
         {
             this.usrMessage.PutMessage("Payment deleted successfully ...");
             this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
             this.usrMessage.Show();
         }
         else
         {
             this.usrMessage.PutMessage("Error to delete payment ");
             this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_ErrorMessage);
             this.usrMessage.Show();
         }
         BindPayment();
     }
     catch (Exception ex)
     {
         throw;
     }
 }