コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 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;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 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;
 }