Ejemplo n.º 1
0
 public ActionResult Edit(AssetType assettype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(assettype).State = EntityState.Modified;
         assettype.CreatedOn = assettype.CreatedOn;
         assettype.LastUpdatedOn = DateTime.Now;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(assettype);
 }
Ejemplo n.º 2
0
        public ActionResult Create(AssetType assettype)
        {
            if (ModelState.IsValid)
            {
                db.AssetTypes.Add(assettype);
                assettype.CreatedOn = DateTime.Now;
                assettype.LastUpdatedOn = DateTime.Now;
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(assettype);
        }