Пример #1
0
 public ActionResult create(VehicleMake v)
 {
     using (db)
     {
         db.VehicleMake.Add(v);
         db.SaveChanges();
     }
     return(View());
 }
Пример #2
0
        public ActionResult Create([Bind(Include = "Id,MakeId,Name")] VehicleModel vehicleModel)
        {
            if (ModelState.IsValid)
            {
                db.VehicleModel.Add(vehicleModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.MakeId = new SelectList(db.VehicleMake, "Id", "Name", vehicleModel.MakeId);
            return(View(vehicleModel));
        }
Пример #3
0
 public void AddVehicleModel(VehicleModel vehiceMod)
 {
     using (db = new vjezbaEntities())
     {
         db.VehicleModel.Add(vehiceMod);
         db.SaveChanges();
     }
 }
Пример #4
0
 public void EditVModel(VehicleModel VModel)
 {
     using (db = new vjezbaEntities())
     {
         db.Entry(VModel).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Пример #5
0
 public void EditVMake(VehicleMake VMake)
 {
     using (vjezbaEntities db = new vjezbaEntities())
     {
         db.Entry(VMake).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Пример #6
0
 public void AddVehicleMake(VehicleMake VehiceM)
 {
     using (vjezbaEntities db = new vjezbaEntities())
     {
         db.VehicleMakes.Add(VehiceM);
         db.SaveChanges();
     }
 }
Пример #7
0
        public void DeleteVehicleModel(int VModelId)
        {
            using (db = new vjezbaEntities())
            {
                vehicleModel = new VehicleModel();
                vehicleModel = db.VehicleModel.Find(VModelId);

                db.VehicleModel.Remove(vehicleModel);
                db.SaveChanges();
            }
        }
Пример #8
0
        public void DeleteVehicleMake(int VMakeId)
        {
            using (db = new vjezbaEntities())
            {
                vehicleMake = new VehicleMake();
                vehicleMake = db.VehicleMake.Find(VMakeId);

                db.VehicleMake.Remove(vehicleMake);
                db.SaveChanges();
            }
        }
Пример #9
0
        public void DeleteVehicleMake(int VMakeId)
        {
            using (vjezbaEntities db = new vjezbaEntities())
            {
                VehicleMake Make = new VehicleMake();
                Make = db.VehicleMakes.Find(VMakeId);

                db.VehicleMakes.Remove(Make);
                db.SaveChanges();
            }
        }