Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var boxerRepository = GetRepository<Boxer>();
            var boxers = boxerRepository.Query().IsProspect().ToList();
            var model = new BoxersViewModel();
            var summarysDic = new Dictionary<string, IEnumerable<BoxerSummary>>();

            foreach (var weight in GetRepository<Weight>().All().OrderBy(x => x.Id).Select(x => x.Name))
            {
                var weightBoxers = boxers.Where(x => x.Weight.Name.Equals(weight)).ToArray().CreateSummarys();
                if (weightBoxers.Count() > 0)
                {
                    summarysDic.Add(weight, weightBoxers.OrderBy(x => x.BoxerName));
                }
            }

            model.BoxersWeights = summarysDic;

            return View(model);
        }
Ejemplo n.º 2
0
        public ActionResult CreateMatches()
        {
            var boxerRepository = GetRepository<Boxer>();
            var weightRepository = GetRepository<Weight>();
            var model = new BoxersViewModel();

            model.AddBoxerControl = new AddingBoxerControlModel(
                weightRepository.All().ToArray(),
                boxerRepository.All().GetAllBoxersInAlpha().CreateSummarys());

            return View(model);
        }
Ejemplo n.º 3
0
        public ActionResult CreateMatch()
        {
            var boxerRepository = GetRepository<Boxer>();
            var weightRepository = GetRepository<Weight>();
            var model = new BoxersViewModel();

            model.AllBoxers = boxerRepository.Query().OrderBy(x=>x.LastName).ToList().CreateSummarys();
            model.AllProspects = boxerRepository.Query().IsProspect().OrderBy(x => x.LastName).ToList().CreateSummarys();

            foreach (var i in model.AllBoxers)
            {
                model.AutoCompleteBoxers += '"' + i.BoxerName + '"' + ',' + ' ';
            }
            model.AutoCompleteBoxers = model.AutoCompleteBoxers.Substring(0, model.AutoCompleteBoxers.Length - 2);

            return View(model);
        }