Esempio n. 1
0
        public ResponseModel getStoreDepartmentList()
        {
            List <StoreDepartmentModel> objDepartmentList = new List <StoreDepartmentModel>();
            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.GetAuthenticateDataFromToken(radisCacheServerAddress, SecurityService.DecryptStringAES(_token));

                MasterCaller newMasterBrand = new MasterCaller();

                objDepartmentList = newMasterBrand.GetStoreDepartmentList(new StoreDepartmentService(connectioSting), authenticate.TenantId);

                StatusCode =
                    objDepartmentList.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 = objDepartmentList;
            }
            catch (Exception)
            {
                throw;
            }
            return(objResponseModel);
        }