Пример #1
0
        public ResponseModel ReadStoreNotification(int NotificatonTypeID, int NotificatonType)
        {
            int           updatecount      = 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.GetAuthenticateDataFromToken(radisCacheServerAddress, SecurityService.DecryptStringAES(token));
                StoreNotificationCaller storeNotificationCaller = new StoreNotificationCaller();

                updatecount = storeNotificationCaller.ReadNotification(new StoreNotificationService(connectioSting), authenticate.TenantId, authenticate.UserMasterID, NotificatonTypeID, NotificatonType);

                statusCode = updatecount > 0 ? (int)EnumMaster.StatusCode.Success : (int)EnumMaster.StatusCode.InternalServiceNotWorking;

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

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

            return(objResponseModel);
        }
Пример #2
0
        public ResponseModel GetStoreNotifications()
        {
            ResponseModel objResponseModel = new ResponseModel();
            ListStoreNotificationModels objresponseModel = new ListStoreNotificationModels();
            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.GetAuthenticateDataFromToken(radisCacheServerAddress, SecurityService.DecryptStringAES(token));

                StoreNotificationCaller storeNotificationCaller = new StoreNotificationCaller();

                objresponseModel = storeNotificationCaller.GetNotification(new StoreNotificationService(connectioSting), authenticate.TenantId, authenticate.UserMasterID);
                statusCode       = objresponseModel == null ? (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 = objresponseModel;
            }
            catch (Exception)
            {
                throw;
            }

            return(objResponseModel);
        }