Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile  = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage       = new Pages(intProfile, dsn);
            oUser       = new Users(intProfile, dsn);
            oTPM        = new TPM(intProfile, dsn, intEnvironment);
            oVariable   = new Variables(intEnvironment);
            oCustomized = new Customized(intProfile, dsn);
            oFunction   = new Functions(intProfile, dsn, intEnvironment);

            if (Request.QueryString["route"] != "" && Request.QueryString["route"] != null)
            {
                strRoute         = Request.QueryString["route"];
                panRoute.Visible = true;
            }

            if (Request.QueryString["view"] != "" && Request.QueryString["view"] != null)
            {
                strView         = Request.QueryString["view"];
                panView.Visible = true;
            }

            if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
            {
                intId = Int32.Parse(Request.QueryString["id"]);
            }

            if (Request.QueryString["work"] != "" && Request.QueryString["work"] != null)
            {
                intWorking = Int32.Parse(Request.QueryString["work"]);
            }

            if (Request.QueryString["exec"] != "" && Request.QueryString["exec"] != null)
            {
                intExecutive = Int32.Parse(Request.QueryString["exec"]);
            }

            if (Request.QueryString["checks"] != "" && Request.QueryString["checks"] != null)
            {
                strChecks = Request.QueryString["checks"].Split(' ');
            }

            if (strView == "PCR")
            {
                ds = oTPM.GetPCRDetail(intId);
                rptView.DataSource = ds;
                rptView.DataBind();
                panNoView.Visible = rptView.Items.Count == 0;
            }
            else if (strView == "CSRC")
            {
                ds = oTPM.GetCSRCDetail(intId);
                rptView.DataSource = ds;
                rptView.DataBind();
                panNoView.Visible = rptView.Items.Count == 0;
            }
            else
            {
                lblW.Text       = oUser.GetFullName(intWorking);
                lblE.Text       = oUser.GetFullName(intExecutive);
                strAttachement += "<tr><td class=\"greenheader\" colspan=\"2\"><b>Attachement(s):</b></td></tr>";
                foreach (string str in strChecks)
                {
                    if (str != "")
                    {
                        string strPath = "";
                        if (strRoute == "CSRC")
                        {
                            strPath = oTPM.GetCSRCPath(Int32.Parse(str));
                        }
                        else if (strRoute == "PCR")
                        {
                            strPath = oTPM.GetPCRPath(Int32.Parse(str));
                        }
                        else
                        {
                            ds      = oTPM.GetProjectClosurePDF(Int32.Parse(str));
                            strPath = ds.Tables[0].Rows[0]["path"].ToString();
                        }
                        string strURL = oVariable.URL() + "/" + strPath.Replace("\\", "/");
                        strAttachement += "<tr><td valign=\"top\" nowrap><a href=\"" + strURL + "\" target=\"_blank\"><img src=\"/images/icons/pdf.gif \" align=\"absmiddle\" border=\"0\" />&nbsp;" + strPath.Substring(strPath.IndexOf("\\") + 1) + "</a></td></tr> ";
                    }
                }
            }

            txtD.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divD.ClientID + "','" + lstD.ClientID + "','" + hdnD.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstD.Attributes.Add("ondblclick", "AJAXClickRow();");
            txtC.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divC.ClientID + "','" + lstC.ClientID + "','" + hdnC.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstC.Attributes.Add("ondblclick", "AJAXClickRow();");


            if (strRoute == "PCR" || strRoute == "CSRC")
            {
                btnRoute.Text = "Route " + strRoute;
                btnRoute.Attributes.Add("onclick", " return confirm('NOTE:This will route the " + strRoute + " to the Approvers listed in the form.\\n Are you sure?');");
            }
            else
            {
                btnRoute.Text  = "Send Notification";
                btnRoute.Width = Unit.Pixel(170);
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile  = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage       = new Pages(intProfile, dsn);
            oUser       = new Users(intProfile, dsn);
            oTPM        = new TPM(intProfile, dsn, intEnvironment);
            oVariable   = new Variables(intEnvironment);
            oCustomized = new Customized(intProfile, dsn);

            if (Request.QueryString["route"] != "" && Request.QueryString["route"] != null)
            {
                strRoute = Request.QueryString["route"];
            }

            if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
            {
                intId = Int32.Parse(Request.QueryString["id"]);
            }

            if (Request.QueryString["work"] != "" && Request.QueryString["work"] != null)
            {
                intWorking = Int32.Parse(Request.QueryString["work"]);
            }

            if (Request.QueryString["exec"] != "" && Request.QueryString["exec"] != null)
            {
                intExecutive = Int32.Parse(Request.QueryString["exec"]);
            }

            if (Request.QueryString["checks"] != "" && Request.QueryString["checks"] != null)
            {
                strChecks = Request.QueryString["checks"].Split(' ');
            }

            if (strRoute == "CSRC")
            {
                intDetailCount = oTPM.GetCSRCDetail(intId).Tables[0].Rows.Count;
            }
            else
            {
                intDetailCount = oTPM.GetPCRDetail(intId).Tables[0].Rows.Count;
            }



            lblW.Text       = oUser.GetFullName(intWorking);
            lblE.Text       = oUser.GetFullName(intExecutive);
            strAttachement += "<tr><td class=\"greenheader\" colspan=\"2\"><b>PCR Attachement(s):</b></td></tr>";
            foreach (string str in strChecks)
            {
                if (str != "")
                {
                    if (strRoute == "CSRC")
                    {
                        ExportCSRCtoPDF(Int32.Parse(str));
                    }
                    else
                    {
                        ExportToPDF(Int32.Parse(str));
                    }
                }
            }

            txtD.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divD.ClientID + "','" + lstD.ClientID + "','" + hdnD.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstD.Attributes.Add("ondblclick", "AJAXClickRow();");
            txtC.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divC.ClientID + "','" + lstC.ClientID + "','" + hdnC.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstC.Attributes.Add("ondblclick", "AJAXClickRow();");
            //btnRoute.Attributes.Add("onclick", "return confirm('NOTE:This will route the PCR to the Approvers listed in the form.\\n Are you sure?');");
            btnRoute.Attributes.Add("onclick", " return confirm('NOTE:This will route the PCR to the Approvers listed in the form.\\n Are you sure?');");
        }