Exemplo n.º 1
0
        /// <summary>
        /// Provides the information for the InventoryWindow from the database
        /// </summary>
        /// <returns></returns>
        public ObservableCollection <clsItemsLogic> theInventory()
        {
            ObservableCollection <clsItemsLogic> inv = new ObservableCollection <clsItemsLogic>();

            try
            {
                int num = 0;
                ds = db.ExecuteSQLStatement(SQLQueries.SelectAllInventory(), ref num);
                for (int i = 0; i < num; i++)
                {
                    clsItemsLogic inventory = new clsItemsLogic();
                    inventory.InventoryLetter = ds.Tables[0].Rows[i][0].ToString();
                    inventory.ItemDesc        = ds.Tables[0].Rows[i][1].ToString();
                    inventory.ItemCost        = Convert.ToDecimal(ds.Tables[0].Rows[i][2].ToString());
                    inv.Add(inventory);
                }
            }
            catch (Exception ex)
            {
                //Just throw the exception
                throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." +
                                    MethodInfo.GetCurrentMethod().Name + " -> " + ex.Message);
            }

            return(inv);
        }
        public MainWindow()
        {
            InitializeComponent();

            // load each of the 3 logic classes, all data will pass through here
            mn = new clsMainLogic();   // Load Main Class
            sl = new clsSearchLogic(); // Load Search Class
            il = new clsItemsLogic();  // Load Item Class
        }