Ejemplo n.º 1
0
        public async Task <IActionResult> Create()
        {
            ViewData["JopId"]    = new SelectList(await _repository.GetJops(), "Id", "Name");
            ViewData["SeasonId"] = new SelectList(await _repository.GetSeasons(), "Id", "Name");
            ViewData["GuideId"]  = new SelectList(await _repository.GetGuides(), "Id", "Name");

            return(View());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create()
        {
            ViewData["CountryId"]      = new SelectList(await _repository.GetCountries(), "Id", "Name");
            ViewData["MGuideId"]       = new SelectList(await _repository.GetGuides(), "Id", "Name");
            ViewData["TypesMessageId"] = new SelectList(await _repository.GetTypesMessages(), "Id", "Name");

            return(View());
        }
        public async Task <IActionResult> Create()
        {
            if (User.IsInRole("RoleGuide"))
            {
                var userId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value);
                var guide  = await _repository.GetGuideByUserId(userId);

                var guids = await _repository.GetGuides();

                ViewData["MGuideId"] = new SelectList(guids.Where(g => g.Id == guide.Id), "Id", "Name", guide.Id);
            }
            else
            {
                ViewData["MGuideId"] = new SelectList(await _repository.GetGuides(), "Id", "Name");
            }

            ViewData["SheikhId"] = new SelectList(await _repository.GetSheikhs(), "Id", "Name");
            return(View());
        }
Ejemplo n.º 4
0
 public async Task <IActionResult> Index()
 {
     return(View(await _repository.GetGuides()));
 }