public ActionResult Create([Bind(Exclude = "ID")] Animals records) { try { records.AddingDate = DateTime.Now; if (recordsDAO.AddRecord(records)) { return(RedirectToAction("Index")); } else { return(View("Create")); } } catch (Exception ex) { return(RedirectToAction("Error", new { ErrorText = ex.Message })); } }
public ActionResult Create([Bind(Exclude = "Id")] Records records) { try { if (recordsDAO.AddRecord(records)) { return(RedirectToAction("Index")); } else { return(View("Create")); } } catch { return(View("Create")); } }