public static Order GetOrder(this OrderRequestModel requestModel)
 {
     return(new Order
     {
         OrderDate = requestModel.OrderDate,
         CustomerID = requestModel.CustomerID,
         CurrencyID = requestModel.CurrencyID,
         PaymentMethodID = requestModel.PaymentMethodID,
         Comments = requestModel.Comments,
         CreationUser = requestModel.CreationUser,
         CreationDateTime = requestModel.CreationDateTime
     });
 }
 public static IEnumerable <OrderDetail> GetOrderDetails(this OrderRequestModel requestModel)
 {
     foreach (var item in requestModel.Details)
     {
         yield return(new OrderDetail
         {
             ProductID = item.ProductID,
             ProductName = item.ProductName,
             UnitPrice = item.UnitPrice,
             Quantity = item.Quantity,
             CreationUser = requestModel.CreationUser,
             CreationDateTime = requestModel.CreationDateTime
         });
     }
 }
Exemplo n.º 3
0
 public static IEnumerable <OrderDetail> GetOrderDetails(this OrderRequestModel requestModel)
 {
     foreach (var item in requestModel.Details)
     {
         yield return(new OrderDetail
         {
             OrderID = item.OrderID,
             ProductID = item.ProductID,
             ProductName = item.ProductName,
             UnitPrice = item.UnitPrice,
             Quantity = item.Quantity,
             Total = item.Total
         });
     }
 }
Exemplo n.º 4
0
 public static Order GetOrder(this OrderRequestModel requestModel)
 {
     return(new Order
     {
         OrderID = requestModel.OrderID,
         OrderDate = requestModel.OrderDate,
         CustomerID = requestModel.CustomerID,
         EmployeeID = requestModel.EmployeeID,
         ShipperID = requestModel.ShipperID,
         Total = requestModel.Total,
         Comments = requestModel.Comments,
         CreationUser = requestModel.CreationUser,
         CreationDateTime = requestModel.CreationDateTime,
         LastUpdateUser = requestModel.LastUpdateUser,
         LastUpdateDateTime = requestModel.LastUpdateDateTime
     });
 }