public IEnumerable <WorkerTicketBLL> searchBy(WorkerTicketBLL worker) { IEnumerable <WorkerTicketDAL> listDAL = new List <WorkerTicketDAL>(); WorkerTicketDAL searchPattern = new WorkerTicketDAL { lastName = worker.lastName, name = worker.name, patronimic = worker.patronimic, number = worker.number, serial = worker.serial, phoneNumber = worker.phoneNumber, spec = worker.speciality, workDays = worker.workDays }; PGUserRepository repository = repositoryFactory.getUserRepository(); listDAL = (repository.searchBy(searchPattern) as IEnumerable <WorkerTicketDAL>); return(listDAL.Select(w => new WorkerTicketBLL { lastName = w.lastName, name = w.name, number = w.number, patronimic = w.patronimic, serial = w.serial, phoneNumber = w.phoneNumber, speciality = w.spec }).AsEnumerable()); }
public IEnumerable <StudentTicketBLL> searchBy(StudentTicketBLL student) { IEnumerable <StudentTicketDAL> listDal = new List <StudentTicketDAL>(); StudentTicketDAL searchPattern = new StudentTicketDAL { lastName = student.lastName, name = student.name, patronimic = student.patronimic, number = student.number, serial = student.serial, facult = student.facult, kurs = student.kurs, group = student.group, speciality = student.speciality, roomNumber = student.roomNumber }; PGUserRepository repository = repositoryFactory.getUserRepository(); listDal = (repository.searchBy(searchPattern) as IEnumerable <StudentTicketDAL>); return(listDal.Select(s => new StudentTicketBLL { lastName = s.lastName, name = s.name, number = s.number, patronimic = s.patronimic, serial = s.serial, facult = s.facult, group = s.group, kurs = s.kurs, speciality = s.speciality, roomNumber = s.roomNumber }).AsEnumerable()); }