コード例 #1
0
        public WorkerTicketBLL searchBySerial(WorkerTicketBLL worker)
        {
            WorkerTicketDAL workDal = new WorkerTicketDAL
            {
                serial      = worker.serial,
                number      = worker.number,
                lastName    = worker.lastName,
                name        = worker.name,
                patronimic  = worker.patronimic,
                spec        = worker.speciality,
                phoneNumber = worker.phoneNumber,
                workDays    = worker.workDays
            };
            WorkerTicketDAL  result;
            PGUserRepository repository = repositoryFactory.getUserRepository();

            result = repository.findBySerial(workDal);
            return(new WorkerTicketBLL
            {
                serial = result.serial,
                number = result.number,
                lastName = result.lastName,
                name = result.name,
                patronimic = result.patronimic,
                phoneNumber = result.phoneNumber,
                speciality = result.spec,
                workDays = result.workDays
            });
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        public void updateData(WorkerTicketBLL updatedWorker)
        {
            WorkerTicketDAL wDal = new WorkerTicketDAL
            {
                name        = updatedWorker.name,
                lastName    = updatedWorker.lastName,
                patronimic  = updatedWorker.patronimic,
                number      = updatedWorker.number,
                serial      = updatedWorker.serial,
                phoneNumber = updatedWorker.phoneNumber,
                spec        = updatedWorker.speciality
            };
            PGUserRepository repository = repositoryFactory.getUserRepository();

            repository.updateInfo(wDal);
        }
コード例 #4
0
        public void deleteUser(WorkerTicketBLL worker)
        {
            PGUserRepository repository = repositoryFactory.getUserRepository();
            WorkerTicketDAL  workerDAL  = new WorkerTicketDAL
            {
                serial      = worker.serial,
                number      = worker.number,
                lastName    = worker.lastName,
                name        = worker.name,
                patronimic  = worker.patronimic,
                phoneNumber = worker.phoneNumber,
                spec        = worker.speciality,
                workDays    = worker.workDays
            };

            repository.removeBySerial(workerDAL);
        }
コード例 #5
0
        public void deleteWorkDay(WorkerTicketBLL worker)
        {
            WorkerTicketDAL wDal = new WorkerTicketDAL
            {
                name        = worker.name,
                lastName    = worker.lastName,
                patronimic  = worker.patronimic,
                number      = worker.number,
                serial      = worker.serial,
                phoneNumber = worker.phoneNumber,
                spec        = worker.speciality,
                workDays    = worker.workDays
            };
            PGUserRepository repository = repositoryFactory.getUserRepository();

            repository.deleteWorkDay(wDal);
        }
コード例 #6
0
        public void addUser(WorkerTicketBLL worker)
        {
            WorkerTicketDAL wDAL = new WorkerTicketDAL
            {
                lastName    = worker.lastName,
                name        = worker.name,
                patronimic  = worker.patronimic,
                number      = worker.number,
                serial      = worker.serial,
                phoneNumber = worker.phoneNumber,
                spec        = worker.speciality
            };

            if (worker.workDays != null)
            {
                wDAL.workDays = worker.workDays;
            }
            PGUserRepository repository = repositoryFactory.getUserRepository();

            repository.addUser(wDAL);
        }