Ejemplo n.º 1
0
        public ActionResult CategoryRoundEdit(Models.Race.RaceCategory.Round.RoundViewModel model)
        {
            if (ModelState.IsValid)
            {
                Data.Models.RaceRound raceRound;

                if (!model.Id.HasValue)
                {
                    raceRound = new Data.Models.RaceRound();
                    raceRound.RaceCategoryId = model.RaceCategoryId;
                }
                else
                {
                    raceRound = RaceRoundRepository.GetById(model.Id.Value);
                }


                raceRound.Name     = model.Name;
                raceRound.Distance = model.Distance;


                if (model.Id.HasValue)
                {
                    RaceRoundRepository.Update(raceRound, true);
                }
                else
                {
                    RaceRoundRepository.Create(raceRound, true);
                }

                return(Content("OK"));
            }
            return(PartialView("/Views/Race/Category/Round/Edit.cshtml", model));
        }
Ejemplo n.º 2
0
 public RoundViewModel(Data.Models.RaceRound raceRound)
 {
     if (raceRound != null)
     {
         Id             = raceRound.Id;
         RaceCategoryId = raceRound.RaceCategoryId;
         Name           = raceRound.Name;
         Distance       = raceRound.Distance;
     }
 }
Ejemplo n.º 3
0
 public RoundGridRow(Data.Models.RaceRound raceRound)
 {
     this.raceRound = raceRound;
 }