Exemple #1
0
        public static UserCustomerInfo ToDtoObject(this Trex.Server.Core.Model.UserCustomerInfo customerInfo)
        {
            var dtoUserCustomerInfo = new UserCustomerInfo();

            dtoUserCustomerInfo.CustomerId  = customerInfo.CustomerId;
            dtoUserCustomerInfo.UserId      = customerInfo.UserId;
            dtoUserCustomerInfo.PricePrHour = customerInfo.PricePrHour;

            return(dtoUserCustomerInfo);
        }
Exemple #2
0
        public void DeleteCustomerInfo(UserCustomerInfo customerInfo)
        {
            var session = GetSession();

            var queryString = "delete from UserCustomerInfo where UserId = :userId and CustomerId = :customerId";

            var query = session.CreateQuery(queryString);

            query.SetInt32("userId", customerInfo.UserId);
            query.SetInt32("customerId", customerInfo.CustomerId);
            query.ExecuteUpdate();
        }
Exemple #3
0
        public UserCustomerInfo Create(User user, Customer customer, double pricePrHour)
        {
            if (user == null)
            {
                throw new ParameterNullOrEmptyException("User cannot be null");
            }
            if (customer == null)
            {
                throw new ParameterNullOrEmptyException("Customer cannot be null");
            }

            var userCustomerInfo = new UserCustomerInfo(user, customer, pricePrHour);

            return(userCustomerInfo);
        }