Beispiel #1
0
 public ActionResult EditTypeProduct(type_products TypeProduct)
 {
     if (ModelState.IsValid)
     {
         var dao       = new TypeProductDao();
         var CreatedAt = dao.GetTypeProduct(TypeProduct.id).created_at;
         TypeProduct.created_at = CreatedAt;
         TypeProduct.updated_at = DateTime.Now;
         dao.EditTypeProduct(TypeProduct);
         TempData["success"] = "Edited Successfully";
         return(RedirectToAction("Index"));
     }
     else
     {
         ModelState.AddModelError("", "Fail Edit");
         return(View("Index"));
     }
 }