예제 #1
0
        /// <summary>
        /// The Page_Load server event handler on this user control is used
        ///  to populate the current portals list from the database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Load(object sender, System.EventArgs e)
        {
            portals = new ArrayList();
            PortalsDB     portalsDb = new PortalsDB();
            SqlDataReader dr        = portalsDb.GetPortals();

            try
            {
                while (dr.Read())
                {
                    PortalItem p = new PortalItem();
                    p.Name = dr["PortalName"].ToString();
                    p.Path = dr["PortalPath"].ToString();
                    p.ID   = Convert.ToInt32(dr["PortalID"].ToString());
                    portals.Add(p);
                }
            }
            finally
            {
                dr.Close();                 //by Manu, fixed bug 807858
            }

            // If this is the first visit to the page, bind the tab data to the page listbox
            if (Page.IsPostBack == false)
            {
                portalList.DataBind();
            }
        }
        /// <summary>
        /// The Page_Load server event handler on this user control is used
        /// to populate the current portals list from the database
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void Page_Load(object sender, EventArgs e)
        {
            portals = new ArrayList();
            PortalsDB     portalsDb = new PortalsDB();
            SqlDataReader dr        = portalsDb.GetPortals();

            try
            {
                while (dr.Read())
                {
                    PortalItem p = new PortalItem();
                    p.Name = dr["PortalName"].ToString();
                    p.Path = dr["PortalPath"].ToString();
                    p.ID   = Convert.ToInt32(dr["PortalID"].ToString());
                    portals.Add(p);
                }
            }
            finally
            {
                dr.Close(); //by Manu, fixed bug 807858
            }

            // If this is the first visit to the page, bind the tab data to the page listbox
            if (Page.IsPostBack == false)
            {
                portalList.DataBind();
            }
            EditBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Edit", "Edit.gif").ImageUrl;
            DeleteBtn.ImageUrl = CurrentTheme.GetImage("Buttons_Delete", "Delete.gif").ImageUrl;
            DeleteBtn.Attributes.Add("onclick", "return confirmDelete();");
        }
예제 #3
0
        private void LoadPortalList()
        {
            portals = new ArrayList();
            PortalsDB     portalsDb = new PortalsDB();
            SqlDataReader dr        = portalsDb.GetPortals();

            try {
                while (dr.Read())
                {
                    PortalItem p = new PortalItem();
                    p.Name = dr["PortalName"].ToString();
                    p.Path = dr["PortalPath"].ToString();
                    p.ID   = Convert.ToInt32(dr["PortalID"].ToString());
                    portals.Add(p);
                }
            } finally {
                dr.Close(); //by Manu, fixed bug 807858
            }
        }