示例#1
0
 public insuranceSvc(ItemManager itemManager, InsuranceDB db, MarketDB marketDB, SystemManager systemManager, BoundServiceManager manager) : base(manager)
 {
     this.DB            = db;
     this.ItemManager   = itemManager;
     this.MarketDB      = marketDB;
     this.SystemManager = systemManager;
 }
示例#2
0
 public insuranceSvc(ItemFactory itemFactory, InsuranceDB db, MarketDB marketDB, WalletManager walletManager, MailManager mailManager, BoundServiceManager manager) : base(manager, null)
 {
     this.DB            = db;
     this.ItemFactory   = itemFactory;
     this.MarketDB      = marketDB;
     this.WalletManager = walletManager;
     this.MailManager   = mailManager;
 }
示例#3
0
 protected insuranceSvc(ItemManager itemManager, InsuranceDB db, MarketDB marketDB, SystemManager systemManager, BoundServiceManager manager, int stationID) : base(manager)
 {
     this.mStationID    = stationID;
     this.DB            = db;
     this.ItemManager   = itemManager;
     this.MarketDB      = marketDB;
     this.SystemManager = systemManager;
 }
示例#4
0
 protected insuranceSvc(ItemFactory itemFactory, InsuranceDB db, MarketDB marketDB, WalletManager walletManager, MailManager mailManager, BoundServiceManager manager, int stationID, Client client) : base(manager, client)
 {
     this.mStationID    = stationID;
     this.DB            = db;
     this.ItemFactory   = itemFactory;
     this.MarketDB      = marketDB;
     this.WalletManager = walletManager;
     this.MailManager   = mailManager;
 }
示例#5
0
 public repairSvc(RepairDB repairDb, MarketDB marketDb, InsuranceDB insuranceDb, NodeContainer nodeContainer, NotificationManager notificationManager, ItemFactory itemFactory, BoundServiceManager manager, WalletManager walletManager) : base(manager, null)
 {
     this.ItemFactory         = itemFactory;
     this.MarketDB            = marketDb;
     this.RepairDB            = repairDb;
     this.InsuranceDB         = insuranceDb;
     this.NotificationManager = notificationManager;
     this.Container           = nodeContainer;
     this.WalletManager       = walletManager;
 }
示例#6
0
 protected repairSvc(RepairDB repairDb, MarketDB marketDb, InsuranceDB insuranceDb, NodeContainer nodeContainer, NotificationManager notificationManager, ItemInventory inventory, ItemFactory itemFactory, BoundServiceManager manager, WalletManager walletManager, Client client) : base(manager, client)
 {
     this.mInventory          = inventory;
     this.ItemFactory         = itemFactory;
     this.MarketDB            = marketDb;
     this.RepairDB            = repairDb;
     this.InsuranceDB         = insuranceDb;
     this.NotificationManager = notificationManager;
     this.Container           = nodeContainer;
     this.WalletManager       = walletManager;
 }
示例#7
0
        public ActionResult MemberQuote(string firstName, string lastName, string emailAddress, string dateBirth, string carYear, string carMake, string CarModel, bool dUI, int speedingTickets, bool fullCoverage)
        {
            //if (string.IsNullOrEmpty(firstName) || string.IsNullOrEmpty(lastName) || string.IsNullOrEmpty(emailAddress) || string.IsNullOrEmpty(dateBirth) ||
            //    string.IsNullOrEmpty(carYear) || string.IsNullOrEmpty(carMake) || string.IsNullOrEmpty(CarModel))
            //{
            //    return View("~/Views/Shared/Error.cshtml");
            //}
            //else
            //{
            using (dOInsuranceEntities db = new dOInsuranceEntities())
            {
                var preQuote = new InsuranceDB();
                preQuote.FirstName       = firstName;
                preQuote.LastName        = lastName;
                preQuote.EmailAddress    = emailAddress;
                preQuote.DateofBirth     = dateBirth; //
                preQuote.CarYear         = carYear;
                preQuote.CarMake         = carMake;
                preQuote.CarModel        = CarModel;
                preQuote.DUI             = dUI;
                preQuote.SpeedingTickets = speedingTickets;
                preQuote.FullCoverage    = fullCoverage;

                //db.InsuranceDBs.Add(preQuote);
                //db.SaveChanges();

                decimal  userQuote    = 50.00m;
                DateTime birthDay     = Convert.ToDateTime(preQuote.DateofBirth);
                int      birthYear    = birthDay.Year;
                int      currentYear  = DateTime.Now.Year;
                int      userAge      = currentYear - birthYear;
                int      autoYear     = Convert.ToInt32(preQuote.CarYear);
                string   carMaker     = preQuote.CarMake;
                string   carMod       = preQuote.CarModel;
                int      speedingTix  = preQuote.SpeedingTickets;
                int      speedingCost = speedingTix * 10;
                bool     DUI          = preQuote.DUI;
                bool     fullCov      = preQuote.FullCoverage;

                //evaluating user age
                if (userAge < 18)
                {
                    userQuote = userQuote + 100;
                }
                else if (userAge < 25)
                {
                    userQuote = userQuote + 25;
                }
                else if (userAge > 100)
                {
                    userQuote = userQuote + 25;
                }
                else
                {
                }

                //evaluating user car's year
                if (autoYear < 2000)
                {
                    userQuote = userQuote + 25;
                }
                else if (autoYear > 2015)
                {
                    userQuote = userQuote + 25;
                }
                else
                {
                }

                //evaluating car's make
                if (carMaker == "Porsche")
                {
                    userQuote = userQuote + 25;
                    if (carMod == "911 Carrera" || carMod == "Carrera" || carMod == "Carrera 4s")
                    {
                        userQuote = userQuote + 25;
                    }
                    else
                    {
                    }
                }
                else
                {
                }

                ////evaluating car's make/model
                //if (carMod == "911 Carrera")
                //{
                //    userQuote = userQuote + 25;
                //}
                //else
                //{
                //}

                //evaluating tickets
                if (speedingTix > 0)
                {
                    userQuote = userQuote + speedingCost;
                }
                else
                {
                }

                //evaluating DUI
                if (DUI == true)
                {
                    userQuote = userQuote * 1.25m;
                }
                else
                {
                }

                //evaluating full coverage
                if (fullCov == true)
                {
                    userQuote = userQuote * 1.50m;
                }
                else
                {
                }

                preQuote.UserQuote = userQuote;
                db.InsuranceDBs.Add(preQuote);
                db.SaveChanges();


                var quoteVMs = new QuoteVM();
                quoteVMs.UserQuote = Math.Round(Convert.ToDecimal(preQuote.UserQuote), 2);

                return(View("Quote", quoteVMs)); //added passing the model
            }
            //}
        }