Example #1
0
        public IActionResult Edit(int id)
        {
            //fetching stage object
            Stage x = _repo.GetByID(id);

            //assigning data from x to Model
            EditStageVM Model = new EditStageVM();

            Model.Id       = x.ID;
            Model.Name     = x.Name;
            Model.Capacity = x.Capacity;

            Model.Sponsors = _repo.GetAllSponsors().Select(s => new SelectListItem
            {
                Text  = s.CompanyName,
                Value = s.ID.ToString(),
            }).ToList();

            Model.SponsorID = (int)x.SponsorID;

            return(View("Edit", Model));
        }
Example #2
0
        public IActionResult Details(int id)
        {
            Stage          s     = _repo.GetByID(id);
            StageDetailsVM Model = new StageDetailsVM
            {
                ID           = s.ID,
                Capacity     = s.Capacity,
                Name         = s.Name,
                SponsorName  = s.Sponsor.CompanyName,
                SponsorImage = s.Sponsor.Image,
                Image        = s.Image
            };

            return(PartialView(Model));
        }