public SalesOrderDataObjectList GetAllSalesOrders() { var salesOrders = salesOrderRepository.FindAll(sort => sort.DateCreated, SortOrder.Descending); var result = new SalesOrderDataObjectList(); salesOrders .ToList() .ForEach(p => result.Add(Mapper.Map <SalesOrder, SalesOrderDataObject>(p))); return(result); }
public SalesOrderDataObjectList GetSalesOrdersForUser(Guid userID) { var user = userRepository.GetByKey(userID); var salesOrders = salesOrderRepository.FindSalesOrdersByUser(user); var salesOrderDataObjectList = new SalesOrderDataObjectList(); foreach (var salesOrder in salesOrders) { salesOrderDataObjectList.Add(Mapper.Map <SalesOrder, SalesOrderDataObject>(salesOrder)); } return(salesOrderDataObjectList); }
public SalesOrderDataObjectList GetSalesOrders(string userName) { User user = userRepository.GetUserByName(userName); var salesOrders = user.SalesOrders; SalesOrderDataObjectList result = new SalesOrderDataObjectList(); if (salesOrders != null) { foreach (var so in salesOrders) { result.Add(Mapper.Map <SalesOrder, SalesOrderDataObject>(so)); } } return(result); }
public SalesOrderDataObjectList GetAllSalesOrders() { var salesOrders = _salesOrderRepository.FindAll(sort => sort.DateCreated, SortOrder.Descending); var result = new SalesOrderDataObjectList(); salesOrders .ToList() .ForEach(p => result.Add(Mapper.Map<SalesOrder, SalesOrderDataObject>(p))); return result; }
public SalesOrderDataObjectList GetSalesOrdersForUser(Guid userID) { var user = userRepository.GetByKey(userID); var salesOrders = salesOrderRepository.FindSalesOrdersByUser(user); var salesOrderDataObjectList = new SalesOrderDataObjectList(); foreach (var salesOrder in salesOrders) salesOrderDataObjectList.Add(Mapper.Map<SalesOrder, SalesOrderDataObject>(salesOrder)); return salesOrderDataObjectList; }
public SalesOrderDataObjectList GetSalesOrders(string userName) { User user = userRepository.GetUserByName(userName); var salesOrders = user.SalesOrders; SalesOrderDataObjectList result = new SalesOrderDataObjectList(); if (salesOrders != null) { foreach (var so in salesOrders) { result.Add(Mapper.Map<SalesOrder, SalesOrderDataObject>(so)); } } return result; }