public ActionResult Create(Material item)
        {
            if (ModelState.IsValid)
            {
                Database.Materials.Add(item);
                item.Time = DateTime.Now;
                Database.SaveChanges();

                return RedirectToAction("Create");
            }
            else
                return View("Edit", item);
        }
 public ActionResult Edit(int id, Material item)
 {
     if (ModelState.IsValid)
     {
         var dbItem = Database.Materials.Find(id);
         TryUpdateModel(dbItem);
         dbItem.Time = DateTime.Now;
         Database.SaveChanges();
         return RedirectToAction("Create");
     }
     else
         return View(item);
 }
 /*This will create a new instance of Material and go to edit mode*/
 public ActionResult Create()
 {
     var model = new Material();
     return View("Edit", model);
 }