示例#1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(hdBranchID.Value))
     {
         BranchDAL oBranchDAL = new BranchDAL();
         Result    oResult    = (Result)oBranchDAL.Detete(hdBranchID.Value);
         if (oResult.Status)
         {
             this.LoadList();
             ClearTextValue();
             hdBranchID.Value = "";
             ucMessage.OpenMessage(Constants.MSG_SUCCESS_DELETE, Constants.MSG_TYPE_SUCCESS);
         }
         else
         {
             if (oResult.Message.Equals(Constants.TABLE_MAIN))
             {
                 ucMessage.OpenMessage(Constants.MSG_APPROVED_DELETE_DATA, Constants.MSG_TYPE_ERROR);
             }
             else
             {
                 ucMessage.OpenMessage(Constants.MSG_ERROR_DELETE, Constants.MSG_TYPE_ERROR);
             }
         }
     }
     else
     {
         ucMessage.OpenMessage(Constants.MSG_ERROR_DELETE, Constants.MSG_TYPE_ERROR);
     }
 }