Ejemplo n.º 1
0
        public RibbonPageCategoryVm AddPageCategory(string caption)
        {
            RibbonPageCategoryVm categoryVm = new RibbonPageCategoryVm(this)
            {
                Caption = caption
            };

            PageCategories.Add(categoryVm);
            return(categoryVm);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates PageCategories for records In the prefilled DataReader, And puts them into a HashTable
        /// </summary>
        /// <param name="dr">The DataReader prefilled With the PageCategories records</param>
        /// <returns>The Hashtable containing PageCategories objects And their ID As key.</returns>
        protected static Hashtable ConvertReaderToHashTable(SqlDataReader dr)
        {
            Hashtable result = new Hashtable();

            while (dr.Read())
            {
                PageCategories myPageCategories = new PageCategories();

                myPageCategories.m_intPageCategoryID   = dr.GetSqlInt32(0);
                myPageCategories.m_strPageCategoryName = dr.GetSqlString(1);

                result.Add(myPageCategories.PageCategoryID, myPageCategories);
            }

            return(result);
        }