コード例 #1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            VehicleEquipmentDamageType vehicleEquipmentDamageType = db.VehicleEquipmentDamageTypes.Find(id);

            db.VehicleEquipmentDamageTypes.Remove(vehicleEquipmentDamageType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,Description,IsMajor")] VehicleEquipmentDamageType vehicleEquipmentDamageType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vehicleEquipmentDamageType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(vehicleEquipmentDamageType));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "Id,Description,IsMajor")] VehicleEquipmentDamageType vehicleEquipmentDamageType)
        {
            if (ModelState.IsValid)
            {
                vehicleEquipmentDamageType.Id = Guid.NewGuid();
                db.VehicleEquipmentDamageTypes.Add(vehicleEquipmentDamageType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(vehicleEquipmentDamageType));
        }
コード例 #4
0
        // GET: VehicleEquipmentDamageTypes/Delete/5
        public ActionResult Delete(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VehicleEquipmentDamageType vehicleEquipmentDamageType = db.VehicleEquipmentDamageTypes.Find(id);

            if (vehicleEquipmentDamageType == null)
            {
                return(HttpNotFound());
            }
            return(View(vehicleEquipmentDamageType));
        }