コード例 #1
0
        public void Run(Quote quote)
        {
            var db = new QuotesDBEntities();

            if (quote.HasMovingViolations)
            {
                var stateId = (int) db.Drivers.First().DLState;
                var discount = db.DiscountPerStates.Single(d => d.DiscountId == discountId && d.StateId == stateId);
                var appliedDiscountValue = new QuoteDiscount()
                    {
                        DiscountId = this.discountId,
                        StateId = stateId,
                        QuoteId = quote.ID,
                        AppliedDiscountValue = discount.Amount
                    };
                db.AddToQuoteDiscounts(appliedDiscountValue);
            }
            db.SaveChanges();
        }
コード例 #2
0
        public void Run(Quote quote)
        {
            var db = new QuotesDBEntities();

            if (quote.HasMovingViolations)
            {
                var stateId              = (int)db.Drivers.First().DLState;
                var discount             = db.DiscountPerStates.Single(d => d.DiscountId == discountId && d.StateId == stateId);
                var appliedDiscountValue = new QuoteDiscount()
                {
                    DiscountId           = this.discountId,
                    StateId              = stateId,
                    QuoteId              = quote.ID,
                    AppliedDiscountValue = discount.Amount
                };
                db.AddToQuoteDiscounts(appliedDiscountValue);
            }
            db.SaveChanges();
        }
コード例 #3
0
ファイル: MultiCar.cs プロジェクト: radtek/Avanade-Ignition
        public void Run(Quote quote)
        {
            var db = new QuotesDBEntities();

            if (quote.ForceMultiCarDiscount)
            {
                var stateId              = quote.StateId;
                var discount             = db.DiscountPerStates.Single(d => d.DiscountId == discountId && d.StateId == stateId);
                var appliedDiscountValue = new QuoteDiscount()
                {
                    DiscountId           = this.discountId,
                    StateId              = stateId,
                    QuoteId              = quote.ID,
                    AppliedDiscountValue = discount.Amount
                };
                db.AddToQuoteDiscounts(appliedDiscountValue);
            }
            db.SaveChanges();
        }
コード例 #4
0
        public void Run(Quote quote)
        {
            var db = new QuotesDBEntities();
            if (quote.ForceMultiCarDiscount)
            {

                var stateId = quote.StateId;
                var discount = db.DiscountPerStates.Single(d => d.DiscountId == discountId && d.StateId == stateId);
                var appliedDiscountValue = new QuoteDiscount()
                    {
                        DiscountId = this.discountId,
                        StateId = stateId,
                        QuoteId = quote.ID,
                        AppliedDiscountValue = discount.Amount
                    };
                db.AddToQuoteDiscounts(appliedDiscountValue);
            }
            db.SaveChanges();
        }
コード例 #5
0
        public void Run(Quote quote)
        {
            var db = new QuotesDBEntities();
            if (quote.PreviousCarrier != null)
            if (quote.PreviousCarrier.ToLower().Contains("pervasive"))
            {

                var stateId = quote.StateId;
                var discount = db.DiscountPerStates.Single(d => d.DiscountId == discountId && d.StateId == stateId);
                var appliedDiscountValue = new QuoteDiscount()
                    {
                        DiscountId = this.discountId,
                        StateId = stateId,
                        QuoteId = quote.ID,
                        AppliedDiscountValue = discount.Amount
                    };
                db.AddToQuoteDiscounts(appliedDiscountValue);
            }
            db.SaveChanges();
        }
コード例 #6
0
        public void Run(Quote quote)
        {
            var db = new QuotesDBEntities();

            if (quote.PreviousCarrier != null)
            {
                if (quote.PreviousCarrier.ToLower().Contains("pervasive"))
                {
                    var stateId              = quote.StateId;
                    var discount             = db.DiscountPerStates.Single(d => d.DiscountId == discountId && d.StateId == stateId);
                    var appliedDiscountValue = new QuoteDiscount()
                    {
                        DiscountId           = this.discountId,
                        StateId              = stateId,
                        QuoteId              = quote.ID,
                        AppliedDiscountValue = discount.Amount
                    };
                    db.AddToQuoteDiscounts(appliedDiscountValue);
                }
            }
            db.SaveChanges();
        }