private void btnAdd_Click(object sender, EventArgs e) { int teamType = (radFunctionalTeam.Checked == true) ? 1 : 0; TeamLogic tl = new TeamLogic(); Team newTeam = new Team(); newTeam.Name = txtName.Text; newTeam.Description = txtDescription.Text; newTeam.Start = dtpStart.Value; newTeam.End = dtpEnd.Value; newTeam.Type = teamType; if (teamType == 0) { newTeam.TeamsProjects.Add(new TeamProject() { TeamId = newTeam.Id, ProjectId = int.Parse(cbxProjects.SelectedValue.ToString()) }); } if (_teamToUpdate == null) { tl.Add(newTeam, _teamMembers); } else { tl.Update(_teamToUpdate, newTeam, _teamMembers); } Close(); }
public ActionResult Create(TeamCreateModel parameters) { var opResult = _teamLogic.Add(parameters); if (opResult.IsSuccess) { return(RedirectToAction("index")); } return(View(parameters)); }