Esempio n. 1
0
        public ServiceResult GetPriceRule(string PriceRuleCode)
        {
            if (string.IsNullOrWhiteSpace(PriceRuleCode))
            {
                return(ServiceResponse.Error("You must provide a code for the rule."));
            }

            PriceManager financeManager = new PriceManager(Globals.DBConnectionKey, this.GetAuthToken(Request));

            PriceRule s = financeManager.GetPriceRuleByCode(PriceRuleCode);

            if (s == null)
            {
                return(ServiceResponse.Error("Invalid code " + PriceRuleCode));
            }

            return(ServiceResponse.OK("", s));
        }
Esempio n. 2
0
        public ServiceResult GetPriceRule(string PriceRuleCode)
        {
            if (string.IsNullOrWhiteSpace(PriceRuleCode))
            {
                return(ServiceResponse.Error("You must provide a name for the strain."));
            }

            PriceManager financeManager = new PriceManager(Globals.DBConnectionKey, Request.Headers?.Authorization?.Parameter);

            PriceRule s = financeManager.GetPriceRuleByCode(PriceRuleCode);

            if (s == null)
            {
                return(ServiceResponse.Error("Invalid code " + PriceRuleCode));
            }

            return(ServiceResponse.OK("", s));
        }