예제 #1
0
파일: UserBl.cs 프로젝트: poliko6/taksopark
 public void CreateComment(Comment comment)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         uow.CommentRepository.Create(comment);
     }
 }
예제 #2
0
파일: UserBl.cs 프로젝트: poliko6/taksopark
 public int CreateRequest(Request request)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         return uow.RequestRepository.Create(request);
     }
 }
예제 #3
0
파일: UserBl.cs 프로젝트: poliko6/taksopark
 public List<Request> GetAllRequestsByCreatorID(int creatorId)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         return uow.RequestRepository.GetAllRequestsByCreatorId(creatorId).ToList();
     }
 }
예제 #4
0
파일: UserBl.cs 프로젝트: poliko6/taksopark
 public List<Comment> GetAllCommentsByRequestId(int requestId)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         return uow.CommentRepository.GetAllCommentsByRequestId(requestId).ToList();
     }
 }
예제 #5
0
 public void CreateCar(Car car)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         uow.CarRepository.Create(car);
     }
 }
예제 #6
0
 public void CreateUser(User user)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         uow.UserRepository.Create(user);
     }
 }
예제 #7
0
파일: UserBl.cs 프로젝트: poliko6/taksopark
 public List<Car> GetAllCars()
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         return uow.CarRepository.GetAllCars().ToList();
     }
 }
예제 #8
0
파일: UserBl.cs 프로젝트: poliko6/taksopark
 public List<Request> GetAllRequests()
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         return uow.RequestRepository.GetAllRequests().ToList();
     }
 }
예제 #9
0
 public Request GetRequestById(int id)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var request = uow.RequestRepository.GetRequestById(id);
         return request;
     }
 }
예제 #10
0
 public List<User> GetAllDrivers()
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var userList = uow.UserRepository.GetUsersByRole((int) RolesEnum.Driver);
         return userList.ToList();
     }
 }
예제 #11
0
 public List<Driver> GetAllDrivers()
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var drivers = uow.DriverRepository.GetAllDrivers();
         return drivers.ToList();
     }
 }
예제 #12
0
 public List<User> GetAllUsersByStatus(int status)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var users = uow.UserRepository.GetAllUsersByStatus(status);
         return users.ToList();
     }
 }
예제 #13
0
 public List<Request> GetAllRequestsByStatus(int status)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var requestList = uow.RequestRepository.GetAllRequestsByStatus(status);
         return requestList.ToList();
     }
 }
예제 #14
0
 public User GetUserById(int id)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var user = uow.UserRepository.GetUserById(id);
         return user;
     }
 }
예제 #15
0
 public Car GetCarById(int id)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var car = uow.CarRepository.GetCarById(id);
         return car;
     }
 }
예제 #16
0
        public void UpdateRequest(Request request)
        {
            var oldRequest = this.GetRequestById(request.Id);

            if ((oldRequest.Status == (int)RequestStatusEnum.Active && request.Status == (int)RequestStatusEnum.Closed)
                || (oldRequest.Status == (int)RequestStatusEnum.InProgress && request.Status == (int)RequestStatusEnum.Active)
                || (oldRequest.Status == (int)RequestStatusEnum.Rejected && request.Status == (int)RequestStatusEnum.Active)
                || (oldRequest.Status == (int)RequestStatusEnum.Rejected && request.Status == (int)RequestStatusEnum.InProgress)
                || (oldRequest.Status == (int)RequestStatusEnum.Rejected && request.Status == (int)RequestStatusEnum.Closed)
                || (oldRequest.Status == (int)RequestStatusEnum.Closed && request.Status == (int)RequestStatusEnum.Active)
                || (oldRequest.Status == (int)RequestStatusEnum.Closed && request.Status == (int)RequestStatusEnum.InProgress)
                || (oldRequest.Status == (int)RequestStatusEnum.Closed && request.Status == (int)RequestStatusEnum.Rejected))
            {
                throw new ArgumentException("Wrong parametrs for request update");
            }
            using (var uow = new UnitOfWork(_appConfigConnection)){

                uow.RequestRepository.Update(request);
            }
        }
예제 #17
0
파일: UserBl.cs 프로젝트: poliko6/taksopark
 public User GetUserByLoginAndPassword(string login, string password)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         return uow.UserRepository.GetUserByLogInAndPassword(login, password);
     }
 }
예제 #18
0
 public bool IsLoginBookedByOtherId(string login, int id)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var isBooked = uow.UserRepository.IsLoginBookedByOtherId(login, id);
         return isBooked;
     }
 }
예제 #19
0
 public bool IsCarIdBooked(int id)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var isBooked = uow.CarRepository.IsCarIdBooked(id);
         return isBooked;
     }
 }
예제 #20
0
 public List<User> GetUserByRole(int role)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var users = uow.UserRepository.GetUsersByRole(role);
         return users.ToList();
     }
 }
예제 #21
0
 public User GetUserByLogin(string login)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         var user = uow.UserRepository.GetUserByLogIn(login);
         return user;
     }
 }
예제 #22
0
파일: UserBl.cs 프로젝트: poliko6/taksopark
 public bool IsLoginBooked(string login)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         return uow.UserRepository.IsLoginBooked(login);
     }
 }
예제 #23
0
파일: UserBl.cs 프로젝트: poliko6/taksopark
 public void UpdateRequest(Request request)
 {
     using (var uow = new UnitOfWork(_appConfigConnection))
     {
         uow.RequestRepository.Update(request);
     }
 }