Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id)
        {
            var guideContract = await _repository.GetGuideContract(id);

            if (guideContract == null)
            {
                ViewBag.ErrorMessage = "لايوجد   بيانات";
                return(View("NotFound"));
            }

            ViewData["JopId"]    = new SelectList(await _repository.GetJops(), "Id", "Name", guideContract.JopId);
            ViewData["SeasonId"] = new SelectList(await _repository.GetSeasons(), "Id", "Name", guideContract.SeasonId);
            ViewData["GuideId"]  = new SelectList(await _repository.GetGuides(), "Id", "Name", guideContract.GuideId);
            return(View(guideContract));
        }