// GET: /Projects/Create
        public virtual ActionResult Create(int? customerId)
        {
            if (customerId == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }

            var projectEdit = new ProjectEdit();
            projectEdit.CustomerId = customerId.Value;

            return this.CreateEditView(projectEdit);
        }
 private ActionResult CreateEditView(ProjectEdit model)
 {
     ViewBag.BoardNames = new SelectList(TaskRegister.ProjectNames(), model.BoardName);
     ViewBag.Customer = CustomerService.GetById(model.CustomerId);
     return View(model);
 }
 public virtual ActionResult Edit(ProjectEdit model)
 {
     return Handle(model, ProjectService.Save,
         () => RedirectToAction(MVC.Projects.View(model.ProjectId)),
         () => model.ProjectId == 0 ?
             RedirectToAction(MVC.Projects.Create(model.CustomerId)) :
             RedirectToAction(MVC.Projects.Edit(model.ProjectId)));
 }