Beispiel #1
0
        public IActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Index"));
            }

            var findCampus = _campusService.GetAdmin(id);

            if (findCampus == null)
            {
                return(RedirectToAction("Index"));
            }

            CampusEditViewModel viewModel = new CampusEditViewModel()
            {
                Id            = findCampus.Id,
                Name          = findCampus.Name,
                Description   = findCampus.Description,
                Slug          = findCampus.Slug,
                EditorContent = findCampus.EditorContent,
                StatusId      = findCampus.Status.Id,
                Address       = findCampus.Address,
                Telephone     = findCampus.Telephone,
                EmailAddress  = findCampus.EmailAddress,
                Fax           = findCampus.Fax
            };

            return(View(viewModel));
        }