コード例 #1
0
        public ActionResult Create()
        {
            var model = new TeamBetTeamXViewModel();
            model.BetTeamList = new SelectList (_betTeamService.GetAll(), SelectLists.DataValueField, SelectLists.DataTextField, SelectLists.UnitializedSelectValue);
            model.TeamList = new SelectList (_teamService.GetAll(), SelectLists.DataValueField, SelectLists.DataTextField, SelectLists.UnitializedSelectValue);

            return View(model);
        }
コード例 #2
0
        public ActionResult Create(TeamBetTeamXViewModel model)
        {
            if (ModelState.IsValid)
            {
                var businessObject = new BOTeamBetTeamX();
                Mapper.Map<TeamBetTeamXViewModel, BOTeamBetTeamX>(model, businessObject);

                businessObject.BetTeam = new BOBetTeam(model.BetTeamListID);
                businessObject.Team = new BOTeam(model.TeamListID);

                _teambetteamxService.Save(businessObject);

                return RedirectToAction("Index");
            }
            model.BetTeamList = new SelectList (_betTeamService.GetAll(), SelectLists.DataValueField, SelectLists.DataTextField, SelectLists.UnitializedSelectValue);
            model.TeamList = new SelectList (_teamService.GetAll(), SelectLists.DataValueField, SelectLists.DataTextField, SelectLists.UnitializedSelectValue);

            return View(model);
        }
コード例 #3
0
 public ActionResult EditProperties(TeamBetTeamXViewModel model)
 {
     return PartialView("_teamBetTeamX", model);
 }
コード例 #4
0
        public ActionResult Edit(TeamBetTeamXViewModel model)
        {
            if (ModelState.IsValid)
            {
                BOTeamBetTeamX businessObject = _teambetteamxService.GetById(model.ID);
                Mapper.Map<TeamBetTeamXViewModel, BOTeamBetTeamX>(model, businessObject);

                _teambetteamxService.Save(businessObject);

                return RedirectToAction("Index");
            }

            return View(model);
        }