public ActionResult Create([Bind(Include = "Id,RequestType,RequestDescription,Status,WorkflowInstanceId,BookMark,CreatedDate,CreatedBy,eMail")] Models.RequestFormViewModel requestForm) { if (ModelState.IsValid) { var request = new DA.Models.Request { CreatedBy = requestForm.CreatedBy, // CreatedDate= requestForm.CreatedDate, RequestDescription = requestForm.RequestDescription, RequestType = requestForm.RequestType, // Status= 1 }; var newAff = new NewAffiliation { eMail = requestForm.eMail }; request.CreatedDate = DateTime.Now; request.Status = RequestState.DRAFT.Value; request.NewAffiliation = newAff; unitOfWork.RequestRepository.Add(request); unitOfWork.Complete(); // return RedirectToAction("Index"); return(RedirectToAction("Draft", "RequestUIFlow", new { Id = request.Id })); } return(View(requestForm)); }
// GET: Requests/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DA.Models.Request request = unitOfWork.RequestRepository.Get((Int32)id); ViewBag.view = RequestConfigHelper.GetStatusConfig(request.Status).view; if (request == null) { return(HttpNotFound()); } return(View(request)); }
public ActionResult Create([Bind(Include = "Id,RequestType,RequestDescription,Status,WorkflowInstanceId,BookMark,CreatedDate,CreatedBy")] DA.Models.Request request) { if (ModelState.IsValid) { request.CreatedDate = DateTime.Now; request.Status = RequestState.DRAFT.Value; unitOfWork.RequestRepository.Add(request); unitOfWork.Complete(); // return RedirectToAction("Index"); return(RedirectToAction("Draft", "RequestUIFlow", new { Id = request.Id })); } return(View(request)); }