Beispiel #1
0
        public ResponseModel AddPriority(string PriorityName, int status)
        {
            StorePriorityCaller storePriorityCaller = new StorePriorityCaller();
            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));
                int result = storePriorityCaller.Addpriority(new StorePriorityService(connectionString), PriorityName, status, authenticate.TenantId, authenticate.UserMasterID);
                statusCode =
                    result == 0 ?
                    (int)EnumMaster.StatusCode.RecordAlreadyExists : (int)EnumMaster.StatusCode.Success;
                statusMessage                 = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)statusCode);
                objResponseModel.Status       = true;
                objResponseModel.StatusCode   = statusCode;
                objResponseModel.Message      = statusMessage;
                objResponseModel.ResponseData = result;
            }
            catch (Exception)
            {
                throw;
            }
            return(objResponseModel);
        }
Beispiel #2
0
        public ResponseModel GetPriorityList()
        {
            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.GetAuthenticateDataFromToken(radisCacheServerAddress, SecurityService.DecryptStringAES(token));

                StorePriorityCaller storePriorityCaller = new StorePriorityCaller();

                objPriority = storePriorityCaller.GetPriorityList(new StorePriorityService(connectionString), authenticate.TenantId);

                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);
        }
Beispiel #3
0
        public ResponseModel UpdatePriorityOrder(int selectedPriorityID, int currentPriorityID)
        {
            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));

                StorePriorityCaller storePriorityCaller = new StorePriorityCaller();
                bool iStatus = storePriorityCaller.UpdatePriorityOrder(new StorePriorityService(connectionString), authenticate.TenantId, selectedPriorityID, currentPriorityID);
                statusCode =
                    iStatus ?
                    (int)EnumMaster.StatusCode.Success : (int)EnumMaster.StatusCode.InternalServerError;

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

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

            return(objResponseModel);
        }
Beispiel #4
0
        public ResponseModel ValidatePriorityNameExist(string priorityName)
        {
            string        resultMessage    = "";
            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));

                StorePriorityCaller storePriorityCaller = new StorePriorityCaller();

                resultMessage = storePriorityCaller.VallidatePriority(new StorePriorityService(connectionString), priorityName, authenticate.TenantId);

                statusCode =
                    string.IsNullOrEmpty(resultMessage) ?
                    (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 = resultMessage;
            }
            catch (Exception)
            {
                throw;
            }


            return(objResponseModel);
        }