Ejemplo n.º 1
0
 public List <ItemsSentAllocationModel> GetAll()
 {
     using (var db = new EntityContext())
     {
         var source = _item.GetAllAllocation(db).ToList();
         var result = _item.AssignItemsAllocation(source);
         return(result);
     }
 }
Ejemplo n.º 2
0
 public List <ItemsSentAllocationModel> GetProductToSend(int routeId, int timeId, DateTime?date, int userId)
 {
     using (var db = new EntityContext())
     {
         var source = _item.GetAllAllocation(db)
                      .Where(i => i.Route.Id == routeId &&
                             i.Time.Id == timeId &&
                             (i.Item.Status.Id == 5 || i.Item.Status.Id == 9 || i.Item.Status.Id == 6 || i.Item.Status.Id == 8 ||
                              i.Item.Status.Id == 10) &&
                             i.DeliveryMan.Id == userId).ToList();
         if (date != null)
         {
             source = source.Where(i => i.DateToDeliver == date).ToList();
         }
         var result = _item.AssignItemsAllocation(source);
         return(result);
     }
 }