예제 #1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         #region  DELETE
         if (HfComplainSrNo.Value != string.Empty)
         {
             string str = BRAND_COMPMASLogicLayer.DeleteBRAND_COMPLAIN_MASDetailByID(HfComplainSrNo.Value);
             if (str.Contains("successfully"))
             {
                 lblmsg.Text      = "Record Deleted Successfully";
                 lblmsg.ForeColor = Color.Green;
             }
             else if (str.Contains("Cannot"))
             {
                 lblmsg.Text      = "Cannot Delete This Record It Used by Other Data";
                 lblmsg.ForeColor = Color.Red;
             }
             else
             {
                 lblmsg.Text      = "Error:Brand Complain Master Not Deleted";
                 lblmsg.ForeColor = Color.Red;
             }
             clear();
             FillGrid(DdlBrandTypeName.SelectedValue);
             UserRights();
         }
         #endregion
     }
     catch (Exception)
     {
         throw;
     }
 }