Esempio n. 1
0
        public IActionResult StaffRecordEdit(int id)
        {
            ViewBag.Departaments  = new SelectList(departamentRepository.GetAllDepartamentRecord(), "DepartamentId", "DepartamentName");
            ViewBag.ProgLanguages = new SelectList(programmingLanguageDataRepository.GetAllProgLanguageRecord(), "LanguageId", "LanguageName");

            return(View(staffDataRepository.FindRecordById(id)));
        }
Esempio n. 2
0
        public StaffViewModel GetStaffInfoById(int id)
        {
            StaffModel model = staffDataRepository.FindRecordById(id);

            return(new StaffViewModel
            {
                Id = model.StaffId,
                Name = model.Name,
                Surname = model.Surname,
                Age = model.Age,
                Gender = model.Gender,
                DepartamentName = departamentRepository.FindDepartamentById(model.DepartamentId).DepartamentName,
                ProgrammingLanguage = programmingLanguageDataRepository.FindProgLanguageById(model.LanguageId).LanguageName
            });
        }