public ActionResult AssignMission(AddMIssionInputModel missionModel) { object response; if (!ModelState.IsValid) { response = "Invalid data!"; return Json(response); } var squad = this.squads.GetById(missionModel.SquadId); var mission = this.Mapper.Map<Mission>(missionModel); if (squad != null) { squad.ActiveMission = mission; } this.squads.Update(squad); response = "Mission assigned!"; return Json(response); }
public ActionResult AssignMission(int squadId) { var viewModel = new AddMIssionInputModel() { SquadId = squadId }; return PartialView("_AddMissionBox", viewModel); }