public ActionResult Create(Logica.Models.BindingModels.TasksCreateBindingModel model) { if (ModelState.IsValid) { Logica.BL.Tasks tasks = new Logica.BL.Tasks(); tasks.CreateTasks(model.Title, model.Details, model.ExpirationDate, model.IsCompleted, model.Effort, model.RemainingWork, model.StateId, model.ActivityId, model.PriorityId, model.ProjectId); return(RedirectToAction("Index", new { projectId = model.ProjectId })); } Logica.BL.States states = new Logica.BL.States(); ViewBag.States = states.GetStates(); Logica.BL.Activities activities = new Logica.BL.Activities(); ViewBag.Activities = activities.GetActivities(); Logica.BL.Priorities priorities = new Logica.BL.Priorities(); ViewBag.Priorities = priorities.GetPriorities(); return(View(model)); }
public ActionResult Create(int?projectId) { var taskBindingModel = new Logica.Models.BindingModels.TasksCreateBindingModel { ProjectId = projectId }; Logica.BL.States states = new Logica.BL.States(); ViewBag.States = states.GetStates(); Logica.BL.Activities activities = new Logica.BL.Activities(); ViewBag.Activities = activities.GetActivities(); Logica.BL.Priorities priorities = new Logica.BL.Priorities(); ViewBag.Priorities = priorities.GetPriorities(); return(View(taskBindingModel)); }