public ActionResult DisplayTeams() { var viewModel = new TeamsVM(); viewModel.TeamList = _league.GetAllTeams().ResponseType; return(View(viewModel)); }
public ActionResult GetAllTeams() { TeamsVM teams = new TeamsVM(); teams.TeamList = _league.GetAllTeams().ResponseType; return(View(teams)); }
public ActionResult CreateTeam() { TeamsVM team = new TeamsVM(); team.Clients = Mapper.Map <List <ClientsVM> >(ClientsDAL.ReadClients()); return(View(team)); }
public ActionResult EditTeam(string currentTeamName) { var viewModel = new TeamsVM(); viewModel.Team = _league.GetAllTeams().ResponseType.FirstOrDefault(t => t.Name == currentTeamName); viewModel.SetPlayers(_league.GetAllPlayersForTeam(viewModel.Team.Name).ResponseType); return(View(viewModel)); }
public ActionResult DeleteTeam(Team team) { _league.DeleteATeam(team); var viewModel = new TeamsVM(); viewModel.TeamList = _league.GetAllTeams().ResponseType; return(RedirectToAction("GetAllTeams")); }
public ActionResult GetAllTeams(string currentTeamName) { var viewModel = new TeamsVM(); var teamList = _league.GetAllPlayersForTeam(currentTeamName).ResponseType; viewModel.TeamList = _league.GetAllTeams().ResponseType; viewModel.PlayerList = teamList; return(View(viewModel)); }
public ActionResult EditTeam(TeamsVM viewModel) { if (ModelState.IsValid) { _league.EditTeam(viewModel.Team); return(RedirectToAction("GetAllTeams")); } viewModel.SetPlayers(_league.GetAllPlayersForTeam(viewModel.Team.Name).ResponseType); return(View(viewModel)); }
// GET: Team/Details/5 public ActionResult Details(int id) { Team t = MyTeamService.GetById(id); TeamsVM TVM = new TeamsVM() { name = t.name }; return(View(TVM)); }
// GET: Team/Edit/5 public ActionResult Edit(int id) { Team t = MyTeamService.GetById(id); TeamsVM tm = new TeamsVM(); tm.name = t.name; // ImageUrl = Image.FileName return(View(tm)); }
public ActionResult Create(TeamsVM TeamsVM, HttpPostedFileBase image) { Team TeamDomain = new Team() { image = image.FileName, name = TeamsVM.name, }; MyTeamService.Add(TeamDomain); MyTeamService.Commit(); //ajout de l'image dans un dossier Upload var path = Path.Combine(Server.MapPath("~/Content/Upload/"), image.FileName); image.SaveAs(path); return(RedirectToAction("Index")); }
public ActionResult Edit(int id, TeamsVM tm) { try { Team t = MyTeamService.GetById(id); t.name = tm.name; MyTeamService.Update(t); MyTeamService.Commit(); // TODO: Add update logic here return(RedirectToAction("Index")); } catch (Exception ex) { return(View(tm)); } }
public ActionResult DeleteTeam(TeamsVM team) { TeamsDAL.DeleteTeam(Mapper.Map <TeamsDM>(team)); return(View()); }