예제 #1
0
        public void Add(Car car)
        {
            if (list.Exists(item => item == car))
                return;

            list.Add(car);
        }
 public ActionResult AddNewCar_Post()
 {
     Car carOne = new Car();
     TryUpdateModel(carOne);
     if (ModelState.IsValid)
     {
         UpdateModel(carOne);
         _carsdata.StoreCartoDb(carOne);
         return RedirectToAction("Cars","Cars");
     }
     return View();
 }
예제 #3
0
 public Policy(Car car)
 {
     Car = car;
     ID = 0;
 }
예제 #4
0
        protected override void loadFromSql()
        {
            DataTable dt = _provider.Select("Car");

            foreach (DataRow row in dt.Rows)
            {
                Car car = new Car(row);
                Add(car);
            }
        }
예제 #5
0
 public void StoreCartoDb(Car newCarDetails)
 {
     ConnectedRepository ctx = new ConnectedRepository(DbName);
     ctx.Cars.Save(newCarDetails);
 }