Exemplo n.º 1
0
 internal static BL.DomainModel.Order AdaptOrder(Order o, BL.DomainModel.Customer c)
 {
     BL.DomainModel.Order order = new BL.DomainModel.Order()
                                      {
                                          OrderId = o.OrderId,
                                          OrderStatus = (OrderStatus) o.OrderStatus,
                                          OrderDate = o.OrderDate,
                                          ShippedDate = o.ShippedDate,
                                          Version = o.Version.ToUlong(),
                                          Customer = c ?? CustomerAdapter.AdaptCustomer(o.CustomerReference)
                                      };
     order.OrderDetails = AdaptOrderDetails(o.OrderDetails, order);
     return order;
 }
Exemplo n.º 2
0
        internal static BL.DomainModel.User AdaptUser(User u)
        {
            BL.DomainModel.User user = new BL.DomainModel.User()
            {
                UserId   = u.UserId,
                UserName = u.Username,
                Password = u.Password,
                Version  = u.Version.ToUlong(),
                Roles    = AdaptRoles(u.Roles)
            };

            user.Customer = CustomerAdapter.AdaptCustomer(u.CustomerReference, user);
            return(user);
        }