示例#1
0
 public CountReportItem(RawItem rawitem)
 {
     name       = rawitem.Name;
     auditcount = rawitem.Stock;
     unit       = rawitem.Unit;
     flag       = rawitem.CountFlag;
 }
示例#2
0
 public static double Convert(Structure.RawItem item, Units to)
 {
     if (Logical.ContainsKey(item.Name))
     {
         if (Logical[item.Name].ContainsKey(item.Unit))
         {
             return(Logical[item.Name][item.Unit].Invoke(to));
         }
         else
         {
             throw new StockItemNotExistedException("[UnitConverter] failed to find unit {0} => [from] for item {1}", item.Unit.ToString(), item.Name);
         }
     }
     else
     {
         throw new StockItemNotExistedException("[UnitConverter] failed to find item {0}", item.Name);
     }
 }