Beispiel #1
0
        public string[] AutocompleteSearch(string term)
        {
            var models = staffDataRepository.GetAllStaffRecord().Where(a => a.Name.Contains(term))
                         .Select(a => a.Name)
                         .ToArray();

            return(models);
        }
Beispiel #2
0
        public List <StaffViewModel> GetStaffInfo()
        {
            var modelList = staffDataRepository.GetAllStaffRecord();

            List <StaffViewModel> staffViews = new List <StaffViewModel>();

            foreach (var item in modelList)
            {
                staffViews.Add(new StaffViewModel
                {
                    Id                  = item.StaffId,
                    Name                = item.Name,
                    Surname             = item.Surname,
                    Age                 = item.Age,
                    Gender              = item.Gender,
                    DepartamentName     = departamentRepository.FindDepartamentById(item.DepartamentId).DepartamentName,
                    ProgrammingLanguage = programmingLanguageDataRepository.FindProgLanguageById(item.LanguageId).LanguageName
                }
                               );
            }

            return(staffViews);
        }