Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            Control oControl;

            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            int intPage = 0;

            if (Request.QueryString["page"] != null && Request.QueryString["page"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["page"]);
            }
            oPage        = new Pages(intProfile, dsn);
            oPageControl = new PageControls(intProfile, dsn);
            if (intPage > 0)
            {
                this.Page.Title = "ClearView | " + oPage.Get(intPage, "browsertitle");
                // Load Page Controls
                DataSet ds = oPageControl.GetPage(intPage, 1);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    oControl = (Control)LoadControl(Request.ApplicationPath + dr["path"].ToString());
                    PH3.Controls.Add(oControl);
                }
            }
        }
Пример #2
0
        public void LoadButton(TableRow _top, TableRow _mid, int _ii, ListBox oList, ListBox oPrev, ListBox oNext)
        {
            TableCell  oCell = new TableCell();
            LinkButton oLink = new LinkButton();

            oLink.Text     = "Add to PH" + _ii.ToString();
            oLink.CssClass = "default";
            oList.CssClass = "default";
            oList.Rows     = 6;
            oList.Width    = Unit.Pixel(180);
            oLink.Attributes.Add("onclick", "return addControl(" + ddlControl.ClientID + ",'" + oList.ClientID + "');");
            oCell.HorizontalAlign = HorizontalAlign.Center;
            oCell.Controls.Add(oLink);
            if (Request.QueryString["type"] == "1")
            {
                LoadControls(oPage.GetPage(Int32.Parse(lblId.Text), 1), "pagecontrolid", oList, "PH" + _ii.ToString());
            }
            _top.Cells.Add(oCell);
            TableCell oCellTop = new TableCell();
            Table     oTable   = new Table();
            TableRow  oRow     = new TableRow();

            oCell         = new TableCell();
            oCell.RowSpan = 5;
            oCell.Controls.Add(oList);
            oRow.Cells.Add(oCell);
            if (_ii == 1)
            {
                LoadCell(oRow, oTable, "", "");
            }
            else
            {
                LoadCell(oRow, oTable, "/admin/images/lt.gif", "return MoveLeft('" + oList.ClientID + "','" + oPrev.ClientID + "');");
            }
            LoadCell(null, oTable, "/admin/images/up.gif", "return MoveUp('" + oList.ClientID + "');");
            LoadCell(null, oTable, "/admin/images/dl.gif", "return MoveOut('" + oList.ClientID + "');");
            LoadCell(null, oTable, "/admin/images/dn.gif", "return MoveDown('" + oList.ClientID + "');");
            if (_ii == intPlaces)
            {
                LoadCell(null, oTable, "", "");
            }
            else
            {
                LoadCell(null, oTable, "/admin/images/rt.gif", "return MoveRight('" + oList.ClientID + "','" + oNext.ClientID + "');");
            }
            oCellTop.Controls.Add(oTable);
            _mid.Cells.Add(oCellTop);
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Control oControl;

            Page.Title = strTitle;
            if (Request.QueryString["down"] != null)
            {
                oControl = (Control)LoadControl("/controls/sys/sys_down.ascx");
                PH3.Controls.Add(oControl);
            }
            else
            {
                oControl = (Control)LoadControl("/controls/sys/sys_will_down.ascx");
                PHDown.Controls.Add(oControl);
                oControl = (Control)LoadControl("/controls/sys/sys_certificate.ascx");
                PHDown.Controls.Add(oControl);
                if (Request.Cookies["profileid"] == null || Request.Cookies["profileid"].Value == "")
                {
                    Response.Cookies["userloginreferrer"].Value = Request.Url.PathAndQuery;
                    oControl = (Control)LoadControl("/controls/sys/sys_login.ascx");
                    PH3.Controls.Add(oControl);
                }
                else
                {
                    intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
                    oUser      = new Users(intProfile, dsn);
                    if (intProfile > 0)
                    {
                        lblName.Text = "<b>Welcome,</b> " + oUser.GetFullName(intProfile) + "&nbsp;&nbsp;(" + oUser.GetName(intProfile).ToUpper() + ")";
                    }
                    oPage           = new Pages(intProfile, dsn);
                    oApplication    = new Applications(intProfile, dsn);
                    oPageControl    = new PageControls(intProfile, dsn);
                    oAppPage        = new AppPages(intProfile, dsn);
                    oDesigner       = new Designer(intProfile, dsn);
                    oServiceRequest = new ServiceRequests(intProfile, dsn);
                    DataSet dsReturned = oServiceRequest.GetReturned(intProfile);
                    if (dsReturned.Tables[0].Rows.Count > 0)
                    {
                        oControl = (Control)LoadControl("/controls/sys/sys_returned.ascx");
                        PH3.Controls.Add(oControl);
                    }
                    oControl = (Control)LoadControl("/controls/sys/sys_topnav.ascx");
                    PH1.Controls.Add(oControl);
                    int intApplication = 0;
                    int intPage        = 0;
                    if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
                    {
                        intApplication = Int32.Parse(Request.QueryString["applicationid"]);
                    }
                    if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
                    {
                        intPage = Int32.Parse(Request.QueryString["pageid"]);
                    }
                    if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
                    {
                        intApplication = Int32.Parse(Request.Cookies["application"].Value);
                    }
                    string strVariables = "";
                    foreach (string strName in Request.QueryString)
                    {
                        if (strName != "pageid" && strName != "apppageid")
                        {
                            strVariables += (strVariables == "" ? "?" : "&") + strName + "=" + Request.QueryString[strName];
                        }
                    }
                    if (intPage > 0)
                    {
                        strPage = oPage.GetFullLink(intPage).Substring(1) + strVariables;
                    }
                    if (intApplication > 0 || intPage > 0)
                    {
                        if (intApplication > 0)
                        {
                            ds = oApplication.Get(intApplication);
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                this.Page.Title = "ClearView | " + ds.Tables[0].Rows[0]["name"].ToString();
                            }
                        }
                        if (intPage > 0)
                        {
                            this.Page.Title = "ClearView | " + oPage.Get(intPage, "browsertitle");
                            // Load Page Controls
                            ds = oPageControl.GetPage(intPage, 1);
                            if (ds.Tables[0].Rows.Count == 0)
                            {
                                oControl = (Control)LoadControl("/controls/sys/sys_pages.ascx");
                                PH3.Controls.Add(oControl);
                            }
                            else
                            {
                                ContentPlaceHolder oPlaceHolder;
                                oPlaceHolder = (ContentPlaceHolder)Master.FindControl("AllContent");
                                foreach (DataRow dr in ds.Tables[0].Rows)
                                {
                                    Control oTempControl = oPlaceHolder.FindControl(dr["placeholder"].ToString());
                                    if (oTempControl != null)
                                    {
                                        oControl = LoadControl(Request.ApplicationPath + dr["path"].ToString());
                                        oTempControl.Controls.Add(oControl);
                                    }
                                }
                            }
                        }
                        else
                        {
                            // Load User's Home Page Controls
                            oControl = (Control)LoadControl("/controls/sys/sys_personal.ascx");
                            PH3.Controls.Add(oControl);
                            //oControl = (Control)LoadControl("/controls/sys/sys_new.ascx");
                            oControl = (Control)LoadControl("/controls/sys/sys_whatsnew.ascx");
                            PH3.Controls.Add(oControl);
                            ds = oDesigner.Get(intProfile, 1);
                            foreach (DataRow dr in ds.Tables[0].Rows)
                            {
                                oControl = (Control)LoadControl(dr["path"].ToString());
                                PH3.Controls.Add(oControl);
                            }
                        }
                    }
                    else
                    {
                        // Load Available Applications
                        oControl = (Control)LoadControl("/controls/sys/sys_application.ascx");
                        PH3.Controls.Add(oControl);
                    }
                }
            }
            oControl = (Control)LoadControl("/controls/sys/sys_rotator_header.ascx");
            PH4.Controls.Add(oControl);
        }