示例#1
0
        public ResponseModel PriorityList(int PriorityFor)
        {
            List <Priority> objPriority      = new List <Priority>();
            ResponseModel   objResponseModel = new ResponseModel();
            int             statusCode       = 0;
            string          statusMessage    = "";

            try
            {
                string       token        = Convert.ToString(Request.Headers["X-Authorized-Token"]);
                Authenticate authenticate = new Authenticate();
                authenticate = SecurityService.GetAuthenticateDataFromTokenCache(Cache, SecurityService.DecryptStringAES(token));

                MasterCaller newMasterSubCat = new MasterCaller();

                objPriority = newMasterSubCat.PriorityList(new PriorityService(Cache, Db), authenticate.TenantId, PriorityFor);

                statusCode =
                    objPriority.Count == 0 ?
                    (int)EnumMaster.StatusCode.RecordNotFound : (int)EnumMaster.StatusCode.Success;

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

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

            return(objResponseModel);
        }