예제 #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();
            }
        }