Пример #1
0
        public async Task <IActionResult> Edit(int id)
        {
            var mGuide = await _repository.GetGuide(id);

            if (mGuide == null)
            {
                ViewBag.ErrorMessage = "لايوجد   بيانات";
                return(View("NotFound"));
            }
            ViewData["CountryId"]        = new SelectList(await _repository.GetCountries(), "Id", "Name", mGuide.CountryId);
            ViewData["BankId"]           = new SelectList(await _repository.GetBanks(), "Id", "Name", mGuide.BankId);
            ViewData["UniversityId"]     = new SelectList(await _repository.GetUniversities(), "Id", "Name", mGuide.UniversityId);
            ViewData["StageId"]          = new SelectList(await _repository.GetStages(), "Id", "Name", mGuide.StageId);
            ViewData["LevelId"]          = new SelectList(await _repository.GetLevels(), "Id", "Name", mGuide.LevelId);
            ViewData["LanguageId"]       = new SelectList(await _repository.GetLanguages(), "Id", "Name", mGuide.LanguageId);
            ViewData["SpecializationId"] = new SelectList(await _repository.GetSpecializations(), "Id", "Name", mGuide.SpecializationId);
            ViewData["AppUserId"]        = new SelectList(await _repository.GetUsers(), "Id", "FullName", mGuide.AppUserId);
            ViewData["CollegeId"]        = new SelectList(await _repository.GetColleges(), "Id", "Name", mGuide.CollegeId);
            return(View(mGuide));
        }