Exemplo n.º 1
0
        public bool CanBeOrdered(ThingDef foodDef)
        {
            // Do we have any item of that type that isn't part of any order?
            var orderedAmount = AllOrders.Where(o => o.consumableDef == foodDef).Sum(o => 1);
            var stockedAmount = Stock.GetAllStockOfDef(foodDef).Sum(item => item.stackCount);

            return(stockedAmount > orderedAmount);
        }
Exemplo n.º 2
0
 public void GetTypeJewelry(string type)
 {
     Orders.Clear();
     if (type == "")
     {
         GetAllOrders();
     }
     else
     {
         Order[] orders = AllOrders.Where(i => i.Jewelry.Type.NameOfJewerly == type).ToArray <Order>();
         foreach (Order o in orders)
         {
             Orders.Add(o);
         }
     }
 }
Exemplo n.º 3
0
 public void GetCodeJewelry(string vc)
 {
     Orders.Clear();
     if (vc == "")
     {
         GetAllOrders();
     }
     else
     {
         Order[] orders = AllOrders.Where(i => i.Jewelry.VenderCode == vc).ToArray <Order>();
         foreach (Order o in orders)
         {
             Orders.Add(o);
         }
     }
 }
Exemplo n.º 4
0
 public void GetNameMasters(string name)
 {
     Orders.Clear();
     if (name == "")
     {
         GetAllOrders();
     }
     else
     {
         Order[] orders = AllOrders.Where(i => i.Master.Surname == name).ToArray <Order>();
         foreach (Order o in orders)
         {
             Orders.Add(o);
         }
     }
 }
Exemplo n.º 5
0
 private void LoadDeliveredOrders()
 {
     DeliveredOrders = new ObservableCollection <Order>(AllOrders.Where(x => x.Ord_status == 3));
 }
Exemplo n.º 6
0
 private void LoadCanceledOrders()
 {
     CanceledOrders = new ObservableCollection <Order>(AllOrders.Where(x => x.Ord_status == 2));
 }
Exemplo n.º 7
0
 private void LoadActiveOrders()
 {
     ActiveOrders = new ObservableCollection <Order>(AllOrders.Where(x => x.Ord_status == 1));
 }
Exemplo n.º 8
0
 private void LoadNewOrders()
 {
     NewOrders = new ObservableCollection <Order>(AllOrders.Where(x => x.Ord_status == 0));
 }