Exemplo n.º 1
0
        /// <summary>
        /// Read Current Page subtabs
        /// </summary>
        /// <param name="PageID">The page ID.</param>
        /// <returns>PagesBox</returns>
        public static PagesBox GetPageSettingsPagesBox(int PageID)
        {
            // Create Instance of Connection and Command Object
            using (SqlConnection myConnection = Config.SqlConnectionString)
            {
                using (SqlCommand myCommand = new SqlCommand("rb_GetTabSettings", myConnection))
                {
                    // Mark the Command as a SPROC
                    myCommand.CommandType = CommandType.StoredProcedure;
                    //PageID passed type FIXED by Bill Anderson (reedtek)
                    //see: http://sourceforge.net/tracker/index.php?func=detail&aid=813789&group_id=66837&atid=515929
                    // Add Parameters to SPROC
                    SqlParameter parameterPageID = new SqlParameter("@PageID", SqlDbType.Int);
                    parameterPageID.Value = PageID;
                    myCommand.Parameters.Add(parameterPageID);
                    // The new paramater "PortalLanguage" has been added to sp rb_GetPageSettings
                    // Onur Esnaf
                    SqlParameter parameterPortalLanguage = new SqlParameter("@PortalLanguage", SqlDbType.NVarChar, 12);
                    parameterPortalLanguage.Value = Thread.CurrentThread.CurrentUICulture.Name;
                    myCommand.Parameters.Add(parameterPortalLanguage);
                    // Open the database connection and execute the command
                    myConnection.Open();

                    using (SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection))
                    {
                        PagesBox tabs = new PagesBox();

                        try
                        {
                            while (result.Read())
                            {
                                PageStripDetails tabDetails = new PageStripDetails();
                                tabDetails.PageID = (int)result["PageID"];
                                Hashtable cts = new PageSettings().GetPageCustomSettings(tabDetails.PageID);
                                tabDetails.PageImage       = cts["CustomMenuImage"].ToString();
                                tabDetails.ParentPageID    = Int32.Parse("0" + result["ParentPageID"]);
                                tabDetails.PageName        = (string)result["PageName"];
                                tabDetails.PageOrder       = (int)result["PageOrder"];
                                tabDetails.AuthorizedRoles = (string)result["AuthorizedRoles"];
                                tabs.Add(tabDetails);
                            }
                        }

                        finally
                        {
                            result.Close();                             //by Manu, fixed bug 807858
                        }
                        return(tabs);
                    }
                }
            }
        }
 /// <summary>
 /// Add
 /// </summary>
 /// <param name="t">The t.</param>
 /// <returns></returns>
 public int Add(PageStripDetails t)
 {
     return(InnerList.Add(t));
 }