예제 #1
0
        public ActionResult Create(DeviceModel devicemodel)
        {
            if (ModelState.IsValid)
            {
                devicemodel.CreateTime = DevTools.GetNowDateTime();
                devicemodel.ModifyTime = devicemodel.CreateTime;
                db.DeviceModels.Add(devicemodel);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(devicemodel);
        }
예제 #2
0
 public ActionResult Edit(DeviceModel devicemodel)
 {
     if (ModelState.IsValid)
     {
         devicemodel.ModifyTime = DevTools.GetNowDateTime();
         db.Entry(devicemodel).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(devicemodel);
 }