public AnalyzePrice GetPrice(Plant plant, AnalyzeWork work)
 {
     var workPrices = Prices.Where(p => p.Work == work).ToList();
     while (plant != null)
     {
         var result = workPrices.FirstOrDefault(p => p.Plant == plant);
         if (result != null)
         {
             return result;
         }
         else
         {
             plant = plant.Parent;
         }
     }
     return null;
 }
Beispiel #2
0
 public AnalyzeWorkItem(AnalyzeWork work, bool isPresent)
     : this()
 {
     Work = work;
     IsPresent = isPresent;
 }
Beispiel #3
0
 private void afterDeserialization(StreamingContext context)
 {
     Work = Cache.Instance.AnalyzeWorks[workId];
 }
Beispiel #4
0
 private void afterDeserialization(StreamingContext context)
 {
     PriceList = Cache.Instance.PriceLists[priceListId];
     if (Cache.Instance is ClientCache)
     {
         PriceList.Prices.Add(this);
     }
     Plant = plantId.HasValue ? Cache.Instance.Plants[plantId.Value] : null;
     Work = Cache.Instance.AnalyzeWorks[workId];
 }