public ActionResult Nuevo(TablaViewModel model) { try { if (ModelState.IsValid) { using (examenEntities db = new examenEntities()) { var oTabla = new queja { Nombre = model.Nombre, matricula = model.Matricula, campus = (int)model.Campus, queja1 = model.Queja, fecha = model.Fecha }; db.quejas.Add(oTabla); db.SaveChanges(); } return(Redirect("/Complain/")); } return(View()); } catch (Exception ex) { throw new Exception(ex.Message); } }
// GET: quejas /* public ActionResult Index() * { * var quejas = db.quejas.Include(q => q.sucursal); * return View(quejas.ToList()); * }*/ // GET: quejas/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } queja queja = db.quejas.Find(id); if (queja == null) { return(HttpNotFound()); } return(View(queja)); }