public ActionResult Create(ProjectRegistrationForm form) { form.PersonId = UserInfoHelper.GetUserId(); if (!ModelState.IsValid) return View(form); _projectService.Register(form); return RedirectToAction("Index"); }
/// <summary> /// регистрация нового проекта /// </summary> /// <param name="form"></param> public void Register(ProjectRegistrationForm form) { var projectId = _endowmentHandlers.Project.Create( form.PersonId, form.Title, form.Content); _endowmentHandlers.ProjectPrice .Create(projectId, form.Price, form.IsOpen, form.PriceAnnotation); _queueService.AppointFirstLevel(projectId); _endowmentHandlers.SaveChanges(); }
/// <summary> /// редактирует и добавляет в историю изменения /// </summary> /// <param name="form"></param> public void Edit(ProjectRegistrationForm form) { _projectEditService.EditAndAddHistory(form.Id, form.Title, form.Content, form.PriceAnnotation, form.Price, form.IsOpen); _endowmentHandlers.SaveChanges(); }
public ActionResult Edit(ProjectRegistrationForm form) { if (!ModelState.IsValid) return View("Edit", form); _projectService.Edit(form); return RedirectToAction("Index"); }
public ActionResult Create() { var model = new ProjectRegistrationForm(); return View(model); }