Example #1
0
        void PopulateArray(clsDataConnection DB)
        {
            Int32 Index = 0;
            Int32 RecordCount;

            RecordCount = DB.Count;
            mStockList  = new List <ClsStock>();
            while (Index < RecordCount)
            {
                ClsStock AnStock = new ClsStock();
                AnStock.ProductNo       = Convert.ToInt32(DB.DataTable.Rows[Index]["ProductNo"]);
                AnStock.StockNo         = Convert.ToInt32(DB.DataTable.Rows[Index]["StockNo"]);
                AnStock.ProductDescript = Convert.ToString(DB.DataTable.Rows[Index]["ProductDescript"]);
                AnStock.DateAdded       = Convert.ToDateTime(DB.DataTable.Rows[Index]["DateAdded"]);
                AnStock.InStck          = Convert.ToBoolean(DB.DataTable.Rows[Index]["InStck"]);
                AnStock.Cost            = Convert.ToInt32(DB.DataTable.Rows[Index]["Cost"]);
                mStockList.Add(AnStock);
                Index++;
            }
        }
Example #2
0
        void ClsStockCollection()
        {
            Int32             Index       = 0;
            Int32             RecordCount = 0;
            clsDataConnection DB          = new clsDataConnection();

            DB.Execute("sproc_tblStock_SelectAll");
            RecordCount = DB.Count;
            while (Index < RecordCount)
            {
                ClsStock AnStock = new ClsStock();

                AnStock.ProductNo       = Convert.ToInt32(DB.DataTable.Rows[Index]["ProductNo"]);
                AnStock.StockNo         = Convert.ToInt32(DB.DataTable.Rows[Index]["StockNo"]);
                AnStock.ProductDescript = Convert.ToString(DB.DataTable.Rows[Index]["ProductDescript"]);
                AnStock.DateAdded       = Convert.ToDateTime(DB.DataTable.Rows[Index]["DateAdded"]);
                AnStock.InStck          = Convert.ToBoolean(DB.DataTable.Rows[Index]["InStck"]);
                AnStock.Cost            = Convert.ToInt32(DB.DataTable.Rows[Index]["Cost"]);
                mStockList.Add(AnStock);
                Index++;
            }
        }