Beispiel #1
0
 /// <summary>
 /// Constructor for the items logic class
 /// </summary>
 public clsItemsLogic()
 {
     try
     {
         SQL   = new clsItemsSQL();
         items = SQL.GetAllItems();
     }
     catch (Exception ex)
     {
         throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." + MethodInfo.GetCurrentMethod().Name + " --> " + ex.Message);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Refreshes the item list, then returns it
 /// </summary>
 /// <returns></returns>
 public List <Item> GetRefreshedItemList()
 {
     try
     {
         items = SQL.GetAllItems();
         //Round the item cost, so it doesn't display oddly
         foreach (Item i in items)
         {
             i.ItemCost = Math.Round(i.ItemCost, 2, MidpointRounding.AwayFromZero);
         }
         return(items);
     }
     catch (Exception ex)
     {
         throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." + MethodInfo.GetCurrentMethod().Name + " --> " + ex.Message);
     }
 }