コード例 #1
0
        public ResponseModel DeleteSLA(int SLAID)
        {
            int           deleteCount      = 0;
            ResponseModel objResponseModel = new ResponseModel();
            int           StatusCode       = 0;
            string        statusMessage    = "";

            try
            {
                ////Get token (Double encrypted) and get the tenant id
                string       token        = Convert.ToString(Request.Headers["X-Authorized-Token"]);
                Authenticate authenticate = new Authenticate();
                authenticate = SecurityService.GetAuthenticateDataFromTokenCache(Cache, SecurityService.DecryptStringAES(token));

                SettingsCaller newSLA = new SettingsCaller();

                deleteCount = newSLA.DeleteSLA(new SLAServices(Cache, Db), authenticate.TenantId, SLAID);

                StatusCode =
                    deleteCount == 0 ?
                    (int)EnumMaster.StatusCode.RecordInUse : (int)EnumMaster.StatusCode.RecordDeletedSuccess;

                statusMessage = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)StatusCode);

                objResponseModel.Status       = true;
                objResponseModel.StatusCode   = StatusCode;
                objResponseModel.Message      = statusMessage;
                objResponseModel.ResponseData = deleteCount;
            }
            catch (Exception)
            {
                throw;
            }

            return(objResponseModel);
        }