Ejemplo n.º 1
0
        public ActionResult Create(Request request)
        {
            if (ModelState.IsValid)
            {
                request.CreatedDate = DateTime.Now;
                //A request after it is created has status 0
                request.Status = 0;
                context.Requests.Add(request);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(request);
        }
Ejemplo n.º 2
0
 public ActionResult Edit(Request request)
 {
     if (ModelState.IsValid)
     {
         context.Entry(request).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(request);
 }