protected void Page_Load(object sender, EventArgs e)
 {
     intProfile      = Int32.Parse(Request.Cookies["profileid"].Value);
     oServiceRequest = new ServiceRequests(intProfile, dsn);
     oPage           = new Pages(intProfile, dsn);
     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);
     }
     strRedirect = oPage.GetFullLink(intViewPage);
     if (intPage == intViewPage)
     {
         panHide.Visible = false;
     }
     else
     {
         lblTitle.Text      = "Returned Requests";
         rptView.DataSource = oServiceRequest.GetReturned(intProfile);
         rptView.DataBind();
     }
 }
Exemple #2
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);
        }