Exemplo n.º 1
0
        public ActionResult Create(Issue newissue)
        {

            if (ModelState.IsValid)
            {
                newissue.CreatedDate = DateTime.Now;
                issue.AddIssue(newissue);
                return RedirectToAction("Index");
            }
            else
            {
                return View(newissue);
            }
        }
Exemplo n.º 2
0
        public ActionResult Edit(Issue currentRequest, FormCollection formCollection)
        {
            if (ModelState.IsValid)
            {
                issue.Entry(currentRequest).State = System.Data.Entity.EntityState.Modified;
                issue.SaveChanges();

                issue.AddHistoryEntry(currentRequest);

                //Get filtering values
                int statusID = GetValue(formCollection["StatusId"]);

                if (statusID == -1)
                {
                    statusID = 1;
                }

                //Write values into Session variables
                Session["StatusId"] = statusID;
                Session["AssignedToFilter"] = GetValue(formCollection["AssignedToFilter"]);
                Session["IssueStatusNameFilter"] = GetValue(formCollection["issueStatusNameFilter"]);
                Session["ReasonFilter"] = (formCollection["ReasonFilter"] == "/") ? String.Empty : formCollection["ReasonFilter"];
                Session["PageNumber"] = GetValue(formCollection["Page"]);
                return RedirectToAction("Index");
            }

            return RedirectToAction("Edit", new { id = currentRequest.Id });
        }