Ejemplo n.º 1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (hdDataType.Value != "M")
     {
         SPTypeDAL oSPTypeDAL = new SPTypeDAL();
         if (hdSPTypeID.Value != "")
         {
             Result oResult = (Result)oSPTypeDAL.Detete(hdSPTypeID.Value);
             if (oResult.Status)
             {
                 ReloadList(oSPTypeDAL, string.Empty);
                 ClearTextValue();
                 ResetDenom();
                 hdDenomID.Value  = string.Empty;
                 hdSPTypeID.Value = string.Empty;
                 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);
         }
     }
     else
     {
         ucMessage.OpenMessage(Constants.MSG_APPROVED_DELETE_DATA, Constants.MSG_TYPE_INFO);
         ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true);
         ClearTextValue();
     }
 }