예제 #1
0
        private void LoadRequest(int intItem, int intApp)
        {
            int intRequest   = Int32.Parse(Request.QueryString["rid"]);
            int intProject   = oRequest.GetProjectNumber(intRequest);
            int intLead      = 0;
            int intTechnical = 0;

            if (intProject > 0)
            {
                if (oProject.Get(intProject, "lead") != "")
                {
                    intLead = Int32.Parse(oProject.Get(intProject, "lead"));
                }
                if (oProject.Get(intProject, "technical") != "")
                {
                    intTechnical = Int32.Parse(oProject.Get(intProject, "technical"));
                }
            }
            else
            {
                try
                {
                    intLead      = Int32.Parse(oProjectsPending.GetRequest(intRequest, "lead"));
                    intTechnical = Int32.Parse(oProjectsPending.GetRequest(intRequest, "technical"));
                }
                catch { }
            }
            Users oUser = new Users(intProfile, dsn);

            if (intLead > 0)
            {
                txtManager.Text = oUser.GetFullName(intLead) + " (" + oUser.GetName(intLead) + ")";
            }
            if (intTechnical > 0)
            {
                txtEngineer.Text = oUser.GetFullName(intTechnical) + " (" + oUser.GetName(intTechnical) + ")";
            }
            hdnLead.Value      = intLead.ToString();
            hdnTechnical.Value = intTechnical.ToString();
            DataSet dsRequest = oCustomized.GetIISRequests(intRequest);

            if (dsRequest.Tables[0].Rows.Count > 0)
            {
                ddlReason.SelectedValue = dsRequest.Tables[0].Rows[0]["reason"].ToString();
                txtStatement.Text       = dsRequest.Tables[0].Rows[0]["statement"].ToString();
                txtStart.Text           = DateTime.Parse(dsRequest.Tables[0].Rows[0]["start_date"].ToString()).ToShortDateString();
                txtEnd.Text             = DateTime.Parse(dsRequest.Tables[0].Rows[0]["end_date"].ToString()).ToShortDateString();
                bool boolExpedite = (dsRequest.Tables[0].Rows[0]["expedite"].ToString() == "1");
                chkExpedite_Yes.Checked = boolExpedite;
                chkExpedite_No.Checked  = !boolExpedite;
            }
            btnNext.Attributes.Add("onclick", "return ValidateHidden0('" + hdnLead.ClientID + "','" + txtManager.ClientID + "','Please enter the LAN ID of your project coordinator')" +
                                   " && ValidateHidden0('" + hdnTechnical.ClientID + "','" + txtEngineer.ClientID + "','Please enter the LAN ID of your integration engineer')" +
                                   " && ValidateDropDown('" + ddlReason.ClientID + "','Please make a selection for the reason')" +
                                   " && ValidateDate('" + txtStart.ClientID + "','Please enter a valid estimated start date')" +
                                   " && ValidateDate('" + txtEnd.ClientID + "','Please enter a valid estimated end date')" +
                                   " && ValidateDates('" + txtStart.ClientID + "','" + txtEnd.ClientID + "','The estimated start date must occur before the estimated end date')" +
                                   ";");
        }
예제 #2
0
        private string getProjectEmailIds(int intProject, int intRequest)
        {
            string strEmailIds = "";
            int    intPC       = 0;
            int    intIE       = 0;

            if (intProject > 0)
            {
                if (oProject.Get(intProject, "lead") != "")
                {
                    intPC = Int32.Parse(oProject.Get(intProject, "lead"));
                }
                if (oProject.Get(intProject, "engineer") != "")
                {
                    intIE = Int32.Parse(oProject.Get(intProject, "engineer"));
                }
            }
            else
            {
                try
                {
                    intPC = Int32.Parse(oProjectsPending.GetRequest(intRequest, "lead"));
                    intIE = Int32.Parse(oProjectsPending.GetRequest(intRequest, "engineer"));
                }
                catch { }
            }

            if (intPC > 0)
            {
                strEmailIds += oUser.GetName(intPC) + ";";
            }
            if (intIE > 0)
            {
                strEmailIds += oUser.GetName(intIE) + ";";
            }

            return(strEmailIds);
        }
예제 #3
0
        protected void LoadRequest()
        {
            int intRequest   = Int32.Parse(Request.QueryString["rid"]);
            int intProject   = oRequest.GetProjectNumber(intRequest);
            int intApproved  = (oProject.IsApproved(intProject) ? 1 : 0);
            int intExecutive = 0;
            int intWorking   = 0;

            if (intProject > 0)
            {
                intExecutive = Int32.Parse(oProject.Get(intProject, "executive"));
                intWorking   = Int32.Parse(oProject.Get(intProject, "working"));
            }
            else
            {
                string strExecutive = oProjectsPending.GetRequest(intRequest, "executive");
                if (strExecutive != "")
                {
                    intExecutive = Int32.Parse(strExecutive);
                }
                string strWorking = oProjectsPending.GetRequest(intRequest, "working");
                if (strWorking != "")
                {
                    intWorking = Int32.Parse(strWorking);
                }
            }
            if (intExecutive > 0)
            {
                txtExecutive.Text = oUser.GetFullName(intExecutive) + " (" + oUser.GetName(intExecutive) + ")";
            }
            hdnExecutive.Value = intExecutive.ToString();
            if (intWorking > 0)
            {
                txtWorking.Text = oUser.GetFullName(intWorking) + " (" + oUser.GetName(intWorking) + ")";
            }
            hdnWorking.Value = intWorking.ToString();
            ProjectRequest oProjectRequest  = new ProjectRequest(intProfile, dsn);
            DataSet        dsProjectRequest = oProjectRequest.GetProject(intProject);

            if (dsProjectRequest.Tables[0].Rows.Count > 0 && intApproved == 1)
            {
                int intProjectRequest = Int32.Parse(dsProjectRequest.Tables[0].Rows[0]["requestid"].ToString());
                txtStatement.Text = oRequest.Get(intProjectRequest, "description");
                txtStart.Text     = DateTime.Parse(oRequest.Get(intProjectRequest, "start_date")).ToShortDateString();
                txtEnd.Text       = DateTime.Parse(oRequest.Get(intProjectRequest, "end_date")).ToShortDateString();
            }
            else
            {
                DataSet       dsProject     = oProject.Get(intProject);
                Organizations oOrganization = new Organizations(intProfile, dsn);
                if (dsProject.Tables[0].Rows.Count > 0)
                {
                    int     intItem = Int32.Parse(lblItem.Text);
                    DataSet ds      = oCustomized.GetTPMServiceRequests(intProject, intItem);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        LoadPrevious(ds);
                    }
                    else
                    {
                        int intApp = oRequestItem.GetItemApplication(intItem);
                        ds = oCustomized.GetTPMServiceRequestsApplication(intProject, intApp);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            LoadPrevious(ds);
                        }
                    }
                }
            }
        }
        protected void btnSubmit_Click(Object Sender, EventArgs e)
        {
            int intResourceParent = Int32.Parse(lblResourceParent.Text);

            ds = oResourceRequest.Get(intResourceParent);
            if (ds.Tables[0].Rows.Count > 0)
            {
                int    intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                int    intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                int    intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                int    intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                string strCVT     = "CVT" + intRequest.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString();
                string strService = oService.GetName(intService);
                if (intService == 0)
                {
                    strService = oRequestItem.GetItemName(intItem);
                }
                int             intApp           = oRequestItem.GetItemApplication(intItem);
                int             intProject       = Int32.Parse(oRequest.Get(intRequest, "projectid"));
                Projects        oProject         = new Projects(intProfile, dsn);
                ProjectsPending oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
                Variables       oVariable        = new Variables(intEnvironment);
                RequestFields   oRequestField    = new RequestFields(intProfile, dsn);
                int             intRequester     = Int32.Parse(oRequest.Get(intRequest, "userid"));
                int             intPC            = 0;
                int             intIE            = 0;
                if (intProject > 0)
                {
                    if (oProject.Get(intProject, "lead") != "")
                    {
                        intPC = Int32.Parse(oProject.Get(intProject, "lead"));
                    }
                    if (oProject.Get(intProject, "engineer") != "")
                    {
                        intIE = Int32.Parse(oProject.Get(intProject, "engineer"));
                    }
                }
                else
                {
                    try
                    {
                        intPC = Int32.Parse(oProjectsPending.GetRequest(intRequest, "lead"));
                        intIE = Int32.Parse(oProjectsPending.GetRequest(intRequest, "engineer"));
                    }
                    catch { }
                }
                string strCC = "";
                if (intPC > 0)
                {
                    strCC += oUser.GetName(intPC) + ";";
                }
                if (intIE > 0)
                {
                    strCC += oUser.GetName(intIE) + ";";
                }
                int intEnhancement = 0;
                if (panEnhancement.Visible)
                {
                    DataSet dsEnhancement = oEnhancement.GetRequest(intRequest);
                    if (dsEnhancement.Tables[0].Rows.Count == 1)
                    {
                        intEnhancement = Int32.Parse(dsEnhancement.Tables[0].Rows[0]["id"].ToString());
                    }
                }
                if (radReject.Checked == true || (panEnhancement.Visible && radEnhancementReject.Checked))
                {
                    string strComments = txtEnhancementReject.Text.Trim();
                    if (strComments == "" && txtReject.Text.Trim() != "")
                    {
                        strComments = "<p>The following comments were added:<br/>" + oFunction.FormatText(txtReject.Text) + "</p>";
                    }
                    string strDefault     = oUser.GetApplicationUrl(intRequester, intAssignPage);
                    string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT,EMAILGRP_REQUEST_STATUS");
                    if (strDefault == "" || oApplication.Get(intApp, "tpm") != "1")
                    {
                        oFunction.SendEmail("Request REJECTED: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request REJECTED: " + strService, "<p>The following request has been rejected by <b>" + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetSummary(intResourceParent, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>" + strComments, true, false);
                    }
                    else
                    {
                        oFunction.SendEmail("Request REJECTED: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request REJECTED: " + strService, "<p>The following request has been rejected by <b>" + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetSummary(intResourceParent, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>" + strComments + "<p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intAssignPage) + "?rrid=" + intResourceParent.ToString() + "\" target=\"_blank\">Click here to assign a new project manager to your request.</a></p>", true, false);
                    }
                    oResourceRequest.UpdateAccepted(intResourceParent, -1);
                    oResourceRequest.UpdateReason(intResourceParent, txtReject.Text);
                    if (panEnhancement.Visible)
                    {
                        oResourceRequest.UpdateStatusOverall(intResourceParent, (int)EnhancementStatus.Denied);
                        oResourceRequest.UpdateReason(intResourceParent, txtEnhancementReject.Text);
                        oEnhancement.AddLog(intEnhancement, 0, "Rejected", intProfile, "");
                    }
                }
                else if (radHold.Checked == true)
                {
                    oResourceRequest.UpdateStatusOverall(intResourceParent, 5);
                    oResourceRequest.UpdateReason(intResourceParent, txtHold.Text);
                }
                else
                {
                    if (panEnhancement.Visible && radEnhancementLong.Checked)
                    {
                        oResourceRequest.UpdateStatusOverall(intResourceParent, (int)EnhancementStatus.AwaitingLongDocument);
                        oEnhancement.AddLog(intEnhancement, 0, "Sent Back to Client for Additonal Requirements", intProfile, "");
                    }
                    else if (panEnhancement.Visible && radEnhancementDuplicate.Checked)
                    {
                        oResourceRequest.UpdateStatusOverall(intResourceParent, (int)EnhancementStatus.Duplicate);
                        oEnhancement.AddLog(intEnhancement, 0, "Duplicate", intProfile, "");
                    }
                    else
                    {
                        if (oResourceRequest.Get(intResourceParent, "assigned") == "") // hasn't already been assigned.
                        {
                            string strComments = "";
                            if (txtComments.Text != "")
                            {
                                strComments = "<p>The following comments were added:<br/>" + oFunction.FormatText(txtComments.Text) + "</p>";
                            }

                            if (panEnhancement.Visible)
                            {
                                oEnhancement.UpdateModuleID(intResourceParent, Int32.Parse(ddlModule.SelectedItem.Value));
                                oEnhancement.AddLog(intEnhancement, 0, "Assigned", intProfile, "");
                            }
                            bool boolSolo     = (oResourceRequest.Get(intResourceParent, "solo") == "1");
                            int  intAssigned  = 0;
                            bool boolRejected = (oResourceRequest.Get(intResourceParent, "accepted") == "-1");
                            if (boolRejected == true)
                            {
                                oResourceRequest.UpdateRejected(intResourceParent, 1);
                                intAssigned = Int32.Parse(Request.Form[hdnManager.UniqueID]);
                            }
                            else
                            {
                                intAssigned = Int32.Parse(ddlUser.SelectedItem.Value);
                                oResourceRequest.UpdateAccepted(intResourceParent, 1);
                            }
                            # region "Send Service Center Notification"
                            // intAssigned = USERID
                            //if (intService = Configuration.AppSettings["DECOMMISSION_SERVER_NEW"]
                            //     get serverid from cv_WM_server_decommission based on requestid, itemid, number
                            //     generate SC email with attachment in HTML format with "Assign TO: USER" at the top (only for non-vmware)

                            //int intServerDecommServiceID = Int32.Parse(ConfigurationManager.AppSettings["SERVICEID_SERVER_DECOMMISSION"]);
                            //if (intService == intServerDecommServiceID)
                            //{
                            //    SendServiceCenterNotification(intRequest, intItem, intNumber, intAssigned);
                            //}
                            #endregion

                            oProject.Update(intProject, 2);
                            int intResourceWorkflow = oResourceRequest.AddWorkflow(intResourceParent, 0, oResourceRequest.Get(intResourceParent, "name"), intAssigned, Int32.Parse(txtQuantity.Text), double.Parse(txtHours.Text), 2, 0);
                            oLog.AddEvent(intRequest.ToString(), strCVT, "Request assigned by " + oUser.GetFullNameWithLanID(intProfile) + " to " + oUser.GetFullNameWithLanID(intAssigned), LoggingType.Debug);
                            oResourceRequest.UpdateComments(intResourceParent, txtComments.Text);
                            oResourceRequest.UpdateAssignedBy(intResourceParent, intProfile);
                            ProjectRequest oProjectRequest = new ProjectRequest(intProfile, dsn);
                            string         strDefault      = oUser.GetApplicationUrl(intAssigned, intViewPage);
                            string         strNotify       = "";
                            string         strSpacerRow    = "<tr><td colspan=\"3\"><img src=\"" + oVariable.ImageURL() + "/images/spacer.gif\" border=\"0\" width=\"1\" height=\"7\" /></td></tr>";
                            if (txtHours.Enabled == true)
                            {
                                oResourceRequest.UpdateDevices(intResourceParent, Int32.Parse(txtQuantity.Text), double.Parse(txtHours.Text));
                            }
                            if (boolSolo == true)
                            {
                                oResourceRequest.UpdateStatusOverall(intResourceParent, 2);
                                if (oApplication.Get(intApp, "tpm") != "1" && oProject.Get(intProject, "number") == "")
                                {
                                    oProject.Update(intProject, oProjectNumber.New());
                                }
                                if (intItem != intImplementorDistributed && intItem != intImplementorMidrange)
                                {
                                    string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT");
                                    //if (oProject.Get(intProject, "number").StartsWith("CV") == false)
                                    //    strNotify = "<p><span style=\"color:#0000FF\"><b>PROJECT COORDINATOR:</b> Please allocate the hours listed above for each resource in Clarity.</span></p>";
                                    if (strDefault == "")
                                    {
                                        oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p>" + strComments + "<p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>", true, false);
                                    }
                                    else
                                    {
                                        if (intProject > 0)
                                        {
                                            oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p>" + strComments + "<p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                        }
                                        else
                                        {
                                            oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p>" + strComments + "<p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                        }
                                    }
                                    string strActivity = "<tr><td><b>Resource:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + oUser.GetFullName(intAssigned) + "</td></tr>";
                                    strActivity += strSpacerRow;
                                    strActivity += "<tr><td><b>Service:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + strService + "</td></tr>";
                                    strActivity  = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>";
                                    string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                                    if (strDeliverable.Trim() != "")
                                    {
                                        strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>";
                                    }
                                    if (oService.Get(intService, "notify_client") != "0")
                                    {
                                        oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>A resource has been assigned to the following request...</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p>" + strActivity + "</p>" + strDeliverable + strNotify, true, false);
                                    }
                                }
                            }
                            else
                            {
                                // ADD PM
                                string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT");
                                if (strDefault == "")
                                {
                                    oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p>" + strComments + "<p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p>", true, false);
                                }
                                else
                                {
                                    if (intProject > 0)
                                    {
                                        oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p>" + strComments + "<p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                    }
                                    else
                                    {
                                        oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p>" + strComments + "<p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                    }
                                }
                                string strExecutive = oProject.Get(intProject, "executive");
                                string strWorking   = oProject.Get(intProject, "working");
                                string strActivity  = "<tr><td><b>Resource:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + oUser.GetFullName(intAssigned) + "</td></tr>";
                                strActivity += strSpacerRow;
                                strActivity += "<tr><td><b>Service:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>Project Coordinator</td></tr>";
                                strActivity  = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>";
                                string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                                if (strDeliverable.Trim() != "")
                                {
                                    strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>";
                                }
                                if (oService.Get(intService, "notify_client") != "0")
                                {
                                    oFunction.SendEmail("Request Assignment", oUser.GetName(intRequester), strExecutive + ";" + strWorking + ";" + strCC, strEMailIdsBCC, "Request Assignment", "<p><b>A resource has been assigned to the following project...</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p>" + strActivity + "</p>" + strDeliverable + strNotify, true, false);
                                }
                            }
                        }
                    }
                }
            }
예제 #5
0
        protected void btnSubmit_Click(Object Sender, EventArgs e)
        {
            int intResourceParent = Int32.Parse(lblResourceParent.Text);

            ds = oResourceRequest.Get(intResourceParent);
            if (ds.Tables[0].Rows.Count > 0)
            {
                int    intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                int    intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                int    intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                int    intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                string strCVT     = "CVT" + intRequest.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString();
                string strService = oService.GetName(intService);
                if (intService == 0)
                {
                    strService = oRequestItem.GetItemName(intItem);
                }
                int             intApp           = oRequestItem.GetItemApplication(intItem);
                int             intProject       = Int32.Parse(oRequest.Get(intRequest, "projectid"));
                Projects        oProject         = new Projects(intProfile, dsn);
                ProjectsPending oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
                Functions       oFunction        = new Functions(intProfile, dsn, intEnvironment);
                Variables       oVariable        = new Variables(intEnvironment);
                RequestFields   oRequestField    = new RequestFields(intProfile, dsn);
                int             intRequester     = Int32.Parse(oRequest.Get(intRequest, "userid"));
                int             intPC            = 0;
                int             intIE            = 0;
                if (intProject > 0)
                {
                    if (oProject.Get(intProject, "lead") != "")
                    {
                        intPC = Int32.Parse(oProject.Get(intProject, "lead"));
                    }
                    if (oProject.Get(intProject, "engineer") != "")
                    {
                        intIE = Int32.Parse(oProject.Get(intProject, "engineer"));
                    }
                }
                else
                {
                    try
                    {
                        intPC = Int32.Parse(oProjectsPending.GetRequest(intRequest, "lead"));
                        intIE = Int32.Parse(oProjectsPending.GetRequest(intRequest, "engineer"));
                    }
                    catch { }
                }
                string strCC = "";
                if (intPC > 0)
                {
                    strCC += oUser.GetName(intPC) + ";";
                }
                if (intIE > 0)
                {
                    strCC += oUser.GetName(intIE) + ";";
                }
                if (radReject.Checked == true)
                {
                    string strComments = "";
                    if (txtComments.Text.Trim() != "")
                    {
                        strComments = "<p>The following comments were added:<br/>" + txtComments.Text + "</p>";
                    }
                    string strDefault = oUser.GetApplicationUrl(intRequester, intAssignPage);
                    strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT,EMAILGRP_REQUEST_STATUS");
                    if (strDefault == "" || oApplication.Get(intApp, "tpm") != "1")
                    {
                        oFunction.SendEmail("Request REJECTED: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request REJECTED: " + strService, "<p><b>The following request has been rejected by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetSummary(intResourceParent, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>" + strComments, true, false);
                    }
                    else
                    {
                        oFunction.SendEmail("Request REJECTED: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request REJECTED: " + strService, "<p><b>The following request has been rejected by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetSummary(intResourceParent, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>" + strComments + "<p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intAssignPage) + "?rrid=" + intResourceParent.ToString() + "\" target=\"_blank\">Click here to assign a new project manager to your request.</a></p>", true, false);
                    }
                    oResourceRequest.UpdateAccepted(intResourceParent, -1);
                    oResourceRequest.UpdateReason(intResourceParent, txtComments.Text);
                }
                else if (radHold.Checked == true)
                {
                    oResourceRequest.UpdateStatusOverall(intResourceParent, 5);
                    oResourceRequest.UpdateReason(intResourceParent, txtHold.Text);
                }
                else
                {
                    if (oApplication.Get(intApp, "tpm") != "1" && oProject.Get(intProject, "number") == "")
                    {
                        oProject.Update(intProject, oProjectNumber.New());
                    }
                    oProject.Update(intProject, 2);
                    bool           boolSolo        = (oResourceRequest.Get(intResourceParent, "solo") == "1");
                    int            intAssigned     = 0;
                    bool           boolRejected    = (oResourceRequest.Get(intResourceParent, "accepted") == "-1");
                    ProjectRequest oProjectRequest = new ProjectRequest(intProfile, dsn);
                    string         strNotify       = "";
                    string         strSpacerRow    = "<tr><td colspan=\"3\"><img src=\"" + oVariable.ImageURL() + "/images/spacer.gif\" border=\"0\" width=\"1\" height=\"7\" /></td></tr>";
                    if (boolRejected == true)
                    {
                        oResourceRequest.UpdateRejected(intResourceParent, 1);
                        intAssigned = Int32.Parse(Request.Form[hdnManager.UniqueID]);
                        int intResourceWorkflow = oResourceRequest.AddWorkflow(intResourceParent, 0, oResourceRequest.Get(intResourceParent, "name"), intAssigned, Int32.Parse(txtQuantity.Text), double.Parse(txtHours.Text), 2, 0);
                        oLog.AddEvent(intRequest.ToString(), strCVT, "Request assigned by " + oUser.GetFullNameWithLanID(intProfile) + " to " + oUser.GetFullNameWithLanID(intAssigned), LoggingType.Debug);
                        string strDefault = oUser.GetApplicationUrl(intAssigned, intViewPage);
                        if (boolSolo == false)
                        {
                            strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT");
                            // ADD PM
                            if (strDefault == "")
                            {
                                oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p>", true, false);
                            }
                            else
                            {
                                if (intProject > 0)
                                {
                                    oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                }
                                else
                                {
                                    oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                }
                            }
                            string strExecutive = oProject.Get(intProject, "executive");
                            string strWorking   = oProject.Get(intProject, "working");
                            string strActivity  = "<tr><td><b>Resource:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + oUser.GetFullName(intAssigned) + "</td></tr>";
                            strActivity += strSpacerRow;
                            strActivity += "<tr><td><b>Service:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>Project Coordinator</td></tr>";
                            strActivity  = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>";
                            string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                            if (strDeliverable.Trim() != "")
                            {
                                strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>";
                            }
                            if (oService.Get(intService, "notify_client") != "0")
                            {
                                strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT");
                                oFunction.SendEmail("Request Assignment", oUser.GetName(intRequester), strExecutive + ";" + strWorking + ";" + strCC, strEMailIdsBCC, "Request Assignment", "<p><b>A resource has been assigned to the following project...</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p>" + strActivity + "</p>" + strDeliverable + strNotify, true, false);
                            }
                        }
                        else
                        {
                            strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_DEVELOPER_ERROR");
                            oFunction.SendEmail("ERROR: Request Assignment", strEMailIdsBCC, "", "", "ERROR: Request Assignment", "<p><b>A REJECTED resource request with a SOLO status of 1 has been assigned to " + oUser.GetName(intAssigned) + "...</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p>", true, false);
                        }
                    }
                    else
                    {
                        oResourceRequest.UpdateAccepted(intResourceParent, 1);
                        if (boolSolo == true)
                        {
                            string  strResources = "";
                            DataSet dsAssigned   = oResourceRequest.GetWorkflowsAssign(intResourceParent);
                            foreach (DataRow drAssigned in dsAssigned.Tables[0].Rows)
                            {
                                intAssigned = Int32.Parse(drAssigned["userid"].ToString());
                                int    intQuantity         = Int32.Parse(drAssigned["devices"].ToString());
                                double dblHours            = double.Parse(drAssigned["allocated"].ToString());
                                int    intResourceWorkflow = oResourceRequest.AddWorkflow(intResourceParent, 0, oResourceRequest.Get(intResourceParent, "name"), intAssigned, intQuantity, dblHours, 2, 0);
                                oLog.AddEvent(intRequest.ToString(), strCVT, "Request assigned by " + oUser.GetFullNameWithLanID(intProfile) + " to " + oUser.GetFullNameWithLanID(intAssigned), LoggingType.Debug);
                                oResourceRequest.UpdateWorkflowStatus(intResourceWorkflow, 2, true);
                                if (intItem != intImplementorDistributed && intItem != intImplementorMidrange)
                                {
                                    //if (oProject.Get(intProject, "number").StartsWith("CV") == false)
                                    //    strNotify = "<p><span style=\"color:#0000FF\"><b>PROJECT COORDINATOR:</b> Please allocate the hours listed above for each resource in Clarity.</span></p>";
                                    string strDefault = oUser.GetApplicationUrl(intAssigned, intViewPage);
                                    strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT");
                                    if (strDefault == "")
                                    {
                                        oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>", true, false);
                                    }
                                    else
                                    {
                                        if (intProject > 0)
                                        {
                                            oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                        }
                                        else
                                        {
                                            oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                        }
                                    }
                                    if (strResources != "")
                                    {
                                        strResources += ", ";
                                    }
                                    strResources += oUser.GetFullName(intAssigned);
                                }
                            }
                            string strActivity = "<tr><td><b>Resource(s):</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + strResources + "</td></tr>";
                            strActivity += strSpacerRow;
                            strActivity += "<tr><td><b>Service:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + strService + "</td></tr>";
                            strActivity  = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>";
                            string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                            strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT");
                            if (strDeliverable.Trim() != "")
                            {
                                strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>";
                            }
                            if (oService.Get(intService, "notify_client") != "0")
                            {
                                oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned...</b><p><p>" + oResourceRequest.GetSummary(intResourceParent, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p>" + strActivity + "</p>" + strDeliverable + strNotify, true, false);
                            }
                        }
                        else
                        {
                            strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_DEVELOPER_ERROR");
                            oFunction.SendEmail("ERROR: Request Assignment", strEMailIdsBCC, "", "", "ERROR: Request Assignment", "<p><b>An ACCEPTED resource request with a SOLO status of 0 has been assigned... RRID = " + intResourceParent.ToString() + "</b></p>", true, false);
                        }
                    }
                    oResourceRequest.UpdateStatusOverall(intResourceParent, 2);
                    oResourceRequest.UpdateAssignedBy(intResourceParent, intProfile);
                }
            }
            Response.Redirect(oPage.GetFullLink(intPage) + "?action=finish");
        }
예제 #6
0
        protected int Save()
        {
            int intReturn = 1;

            oResourceRequest.UpdateName(intResource, txtName.Text);
            double dblAllocated = 0.00;

            if (panDynamic.Visible == false)
            {
                dblAllocated = double.Parse(txtAllocated.Text);
            }
            else
            {
                double dblQuantity = double.Parse(txtDevices.Text);
                dblAllocated = oServiceDetail.GetHours(Int32.Parse(txtAllocated.ToolTip), dblQuantity);
            }
            oResourceRequest.UpdateDevices(intResource, Int32.Parse(txtDevices.Text), dblAllocated);
            oResourceRequest.UpdateAccepted(intResource, Int32.Parse(ddlAccepted.SelectedItem.Value));
            oResourceRequest.UpdateStatusOverall(intResource, Int32.Parse(ddlStatus.SelectedItem.Value));
            oResourceRequest.UpdateReason(intResource, txtReason.Text);
            if (Request.Form[hdnAssignedBy.UniqueID] != "" && Request.Form[hdnAssignedBy.UniqueID] != "0")
            {
                oResourceRequest.UpdateAssignedBy(intResource, Int32.Parse(Request.Form[hdnAssignedBy.UniqueID]));
            }

            if (trAdmin.Visible == true)
            {
                int intUser = 0;
                if (Int32.TryParse(Request.Form[hdnUser.UniqueID], out intUser) == true)
                {
                    // Assign resource
                    DataSet ds = oResourceRequest.Get(intResource);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        int    intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                        int    intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                        int    intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                        int    intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                        string strCVT     = "CVT" + intRequest.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString();
                        string strService = oService.GetName(intService);
                        if (intService == 0)
                        {
                            strService = oRequestItem.GetItemName(intItem);
                        }
                        int       intApp     = oRequestItem.GetItemApplication(intItem);
                        int       intProject = Int32.Parse(oRequest.Get(intRequest, "projectid"));
                        Variables oVariable  = new Variables(intEnvironment);

                        DataSet dsWorkflow = oResourceRequest.GetWorkflowsParent(intResource);
                        if (dsWorkflow.Tables[0].Rows.Count == 0)
                        {
                            // New Assignment
                            Projects        oProject         = new Projects(intProfile, dsn);
                            ProjectsPending oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
                            int             intRequester     = Int32.Parse(oRequest.Get(intRequest, "userid"));
                            int             intPC            = 0;
                            int             intIE            = 0;
                            if (intProject > 0)
                            {
                                if (oProject.Get(intProject, "lead") != "")
                                {
                                    intPC = Int32.Parse(oProject.Get(intProject, "lead"));
                                }
                                if (oProject.Get(intProject, "engineer") != "")
                                {
                                    intIE = Int32.Parse(oProject.Get(intProject, "engineer"));
                                }
                            }
                            else
                            {
                                try
                                {
                                    intPC = Int32.Parse(oProjectsPending.GetRequest(intRequest, "lead"));
                                    intIE = Int32.Parse(oProjectsPending.GetRequest(intRequest, "engineer"));
                                }
                                catch { }
                            }
                            string strCC = "";
                            if (intPC > 0)
                            {
                                strCC += oUser.GetName(intPC) + ";";
                            }
                            if (intIE > 0)
                            {
                                strCC += oUser.GetName(intIE) + ";";
                            }

                            bool boolSolo     = (oResourceRequest.Get(intResource, "solo") == "1");
                            int  intAssigned  = 0;
                            bool boolRejected = (oResourceRequest.Get(intResource, "accepted") == "-1");
                            intAssigned = intUser;
                            oResourceRequest.UpdateAccepted(intResource, 1);

                            oProject.Update(intProject, 2);
                            int intResourceWorkflow = oResourceRequest.AddWorkflow(intResource, 0, oResourceRequest.Get(intResource, "name"), intAssigned, 1, 1.00, 2, 0);
                            oLog.AddEvent(intRequest.ToString(), strCVT, "Request assigned by " + oUser.GetFullNameWithLanID(intProfile) + " (ADMIN) to " + oUser.GetFullNameWithLanID(intAssigned), LoggingType.Debug);
                            oResourceRequest.UpdateAssignedBy(intResource, intProfile);
                            ProjectRequest oProjectRequest = new ProjectRequest(intProfile, dsn);
                            string         strDefault      = oUser.GetApplicationUrl(intAssigned, intViewPage);
                            string         strNotify       = "";
                            string         strSpacerRow    = "<tr><td colspan=\"3\"><img src=\"" + oVariable.ImageURL() + "/images/spacer.gif\" border=\"0\" width=\"1\" height=\"7\" /></td></tr>";
                            oResourceRequest.UpdateDevices(intResource, 1, 1.00);
                            if (boolSolo == true)
                            {
                                oResourceRequest.UpdateStatusOverall(intResource, 2);
                                if (oApplication.Get(intApp, "tpm") != "1" && oProject.Get(intProject, "number") == "")
                                {
                                    oProject.Update(intProject, oProjectNumber.New());
                                }
                                if (chkEmail.Checked == false)
                                {
                                    if (intItem != intImplementorDistributed && intItem != intImplementorMidrange)
                                    {
                                        string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT");
                                        //if (oProject.Get(intProject, "number").StartsWith("CV") == false)
                                        //    strNotify = "<p><span style=\"color:#0000FF\"><b>PROJECT COORDINATOR:</b> Please allocate the hours listed above for each resource in Clarity.</span></p>";
                                        if (strDefault == "")
                                        {
                                            oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>", true, false);
                                        }
                                        else
                                        {
                                            if (intProject > 0)
                                            {
                                                oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                            }
                                            else
                                            {
                                                oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                            }
                                        }
                                        string strActivity = "<tr><td><b>Resource:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + oUser.GetFullName(intAssigned) + "</td></tr>";
                                        strActivity += strSpacerRow;
                                        strActivity += "<tr><td><b>Service:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + strService + "</td></tr>";
                                        strActivity  = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>";
                                        string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                                        if (strDeliverable.Trim() != "")
                                        {
                                            strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>";
                                        }
                                        if (oService.Get(intService, "notify_client") != "0")
                                        {
                                            oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>A resource has been assigned to the following request...</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p>" + strActivity + "</p>" + strDeliverable + strNotify, true, false);
                                        }
                                    }
                                }
                            }
                            else
                            {
                                // ADD PM
                                if (chkEmail.Checked == false)
                                {
                                    string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT");
                                    if (strDefault == "")
                                    {
                                        oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p>", true, false);
                                    }
                                    else
                                    {
                                        if (intProject > 0)
                                        {
                                            oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                        }
                                        else
                                        {
                                            oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                        }
                                    }
                                    string strExecutive = oProject.Get(intProject, "executive");
                                    string strWorking   = oProject.Get(intProject, "working");
                                    string strActivity  = "<tr><td><b>Resource:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + oUser.GetFullName(intAssigned) + "</td></tr>";
                                    strActivity += strSpacerRow;
                                    strActivity += "<tr><td><b>Service:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>Project Coordinator</td></tr>";
                                    strActivity  = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>";
                                    string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                                    if (strDeliverable.Trim() != "")
                                    {
                                        strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>";
                                    }
                                    if (oService.Get(intService, "notify_client") != "0")
                                    {
                                        oFunction.SendEmail("Request Assignment", oUser.GetName(intRequester), strExecutive + ";" + strWorking + ";" + strCC, strEMailIdsBCC, "Request Assignment", "<p><b>A resource has been assigned to the following project...</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p>" + strActivity + "</p>" + strDeliverable + strNotify, true, false);
                                    }
                                }
                            }
                        }
                        else
                        {
                            // Update Assignee
                            int intResourceWorkflow = Int32.Parse(dsWorkflow.Tables[0].Rows[0]["id"].ToString());
                            int intOldUser          = Int32.Parse(dsWorkflow.Tables[0].Rows[0]["userid"].ToString());
                            if (chkEmail.Checked == false)
                            {
                                string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT");
                                string strSpacerRow   = "<tr><td colspan=\"3\"><img src=\"" + oVariable.ImageURL() + "/images/spacer.gif\" border=\"0\" width=\"1\" height=\"7\" /></td></tr>";
                                string strDefault     = oUser.GetApplicationUrl(intUser, intViewPage);
                                // Notify Old User
                                // NOTIFICATION
                                oFunction.SendEmail("Request Assignment", oUser.GetName(intOldUser), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following request has been removed from your workload</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>", true, false);
                                // Notify New User
                                if (strDefault == "")
                                {
                                    oFunction.SendEmail("Request Assignment", oUser.GetName(intUser), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following request has been re-assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>", true, false);
                                }
                                else
                                {
                                    if (intProject > 0)
                                    {
                                        oFunction.SendEmail("Request Assignment", oUser.GetName(intUser), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following request has been re-assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                    }
                                    else
                                    {
                                        oFunction.SendEmail("Request Assignment", oUser.GetName(intUser), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following request has been re-assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false);
                                    }
                                }
                                string strActivity = "<tr><td><b>Resource:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + oUser.GetFullName(intUser) + "</td></tr>";
                                strActivity += strSpacerRow;
                                strActivity += "<tr><td><b>Activity Type:</b></td><td>&nbsp;&nbsp;&nbsp;</td><td>" + oService.GetName(intService) + "</td></tr>";
                                strActivity  = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>";
                                string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                                if (strDeliverable.Trim() != "")
                                {
                                    strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>";
                                }
                            }
                            oResourceRequest.UpdateWorkflowAssigned(intResourceWorkflow, intUser);
                        }
                    }
                }
            }
            return(intReturn);
        }
예제 #7
0
        private void LoadRequest(int intApp)
        {
            Users oUser      = new Users(intProfile, dsn);
            int   intRequest = Int32.Parse(Request.QueryString["rid"]);
            int   intProject = oRequest.GetProjectNumber(intRequest);
            int   intWorking = 0;

            if (intProject > 0)
            {
                intWorking = Int32.Parse(oProject.Get(intProject, "working"));
            }
            else
            {
                string strWorking = oProjectsPending.GetRequest(intRequest, "working");
                if (strWorking != "")
                {
                    intWorking = Int32.Parse(strWorking);
                }
            }
            if (intWorking > 0)
            {
                txtWorking.Text = oUser.GetFullName(intWorking) + " (" + oUser.GetName(intWorking) + ")";
            }
            hdnWorking.Value = intWorking.ToString();
            DataSet dsRequest = oCustomized.GetRemediationRequests(intRequest);

            if (dsRequest.Tables[0].Rows.Count > 0)
            {
                ddlReason.SelectedValue    = dsRequest.Tables[0].Rows[0]["reason"].ToString();
                ddlComponent.SelectedValue = dsRequest.Tables[0].Rows[0]["component"].ToString();
                ddlFunding.SelectedValue   = dsRequest.Tables[0].Rows[0]["funding"].ToString();
                ddlFunding.Visible         = true;
                radPriority.SelectedValue  = dsRequest.Tables[0].Rows[0]["priority"].ToString();
                string strTPM = dsRequest.Tables[0].Rows[0]["tpm"].ToString();
                if (strTPM == "")
                {
                    radTPM_No.Checked = true;
                }
                txtStatement.Text = dsRequest.Tables[0].Rows[0]["statement"].ToString();
                txtDevices.Text   = dsRequest.Tables[0].Rows[0]["devices"].ToString();
                txtHours.Text     = dsRequest.Tables[0].Rows[0]["hours"].ToString();
                txtStart.Text     = DateTime.Parse(dsRequest.Tables[0].Rows[0]["start_date"].ToString()).ToShortDateString();
                txtEnd.Text       = DateTime.Parse(dsRequest.Tables[0].Rows[0]["end_date"].ToString()).ToShortDateString();
            }
            else
            {
                radPriority.SelectedValue = "3";
                int            intApproved       = (oProject.IsApproved(intProject) ? 1 : 0);
                ProjectRequest oProjectRequest   = new ProjectRequest(intProfile, dsn);
                DataSet        dsProjectRequest  = oProjectRequest.GetProject(intProject);
                int            intProjectRequest = 0;
                if (dsProjectRequest.Tables[0].Rows.Count > 0 && intApproved == 1)
                {
                    intProjectRequest  = Int32.Parse(dsProjectRequest.Tables[0].Rows[0]["requestid"].ToString());
                    lblFunding.Text    = dsProjectRequest.Tables[0].Rows[0]["expected_capital"].ToString();
                    lblFunding.Visible = true;
                    txtStatement.Text  = oRequest.Get(intRequest, "description");
                    txtStart.Text      = DateTime.Parse(oRequest.Get(intRequest, "start_date")).ToShortDateString();
                    btnNext.Attributes.Add("onclick", "return ValidateDropDown('" + ddlReason.ClientID + "','Please make a selection for the reason')" +
                                           " && ValidateDropDown('" + ddlComponent.ClientID + "','Please make a selection for the component')" +
                                           " && ValidateText('" + txtStatement.ClientID + "','Please enter a statement of work')" +
                                           " && ValidateNumber('" + txtDevices.ClientID + "','Please enter a valid number of devices')" +
                                           " && ValidateNumber0('" + txtHours.ClientID + "','Please enter a valid number of hours')" +
                                           " && ValidateDate('" + txtStart.ClientID + "','Please enter a valid estimated start date')" +
                                           " && ValidateDate('" + txtEnd.ClientID + "','Please enter a valid estimated end date')" +
                                           " && ValidateDateHidden('" + txtEnd.ClientID + "','" + hdnEnd.ClientID + "','NOTE: Based on your priority, your end date cannot occur before a certain time.\\n\\n')" +
                                           " && ValidateDates('" + txtStart.ClientID + "','" + txtEnd.ClientID + "','The estimated start date must occur before the estimated end date')" +
                                           ";");
                    int     intRequestor = Int32.Parse(oRequest.Get(intProjectRequest, "userid"));
                    DataSet dsProject    = oProjectRequest.GetResources(intProjectRequest);
                    if (dsProject.Tables[0].Rows.Count > 0)
                    {
                        panPM.Visible = true;
                        int intItem     = Int32.Parse(dsProject.Tables[0].Rows[0]["itemid"].ToString());
                        int intService  = Int32.Parse(dsProject.Tables[0].Rows[0]["serviceid"].ToString());
                        int intAccepted = Int32.Parse(dsProject.Tables[0].Rows[0]["accepted"].ToString());
                        int intManager  = Int32.Parse(dsProject.Tables[0].Rows[0]["userid"].ToString());
                        if (intAccepted == -1)
                        {
                            lblPM.Text = "<i>Pending Assignment</i><br><font class=\"footer\">(" + oUser.GetFullName(intRequestor) + ")</font>";
                        }
                        else if (intManager > 0)
                        {
                            lblPM.Text = oUser.GetFullName(intManager);
                            if (intItem == 0)
                            {
                                radTPM_No.Checked = true;
                            }
                            else
                            {
                                radTPM_Yes.Checked = true;
                            }
                            radTPM_No.Enabled  = false;
                            radTPM_Yes.Enabled = false;
                        }
                        else if (intItem > 0)
                        {
                            lblPM.Text = "<i>Pending Assignment</i><br><font class=\"footer\">(" + oService.GetName(intService) + ")</font>";
                        }
                    }
                    else
                    {
                        lblPM.Text = "<i>Pending Technical Project Management Service Request</i>";
                    }
                }
                else
                {
                    ddlFunding.Visible = true;
                    radTPM_No.Checked  = true;
                    btnNext.Attributes.Add("onclick", "return ValidateHidden('" + hdnWorking.ClientID + "','" + txtWorking.ClientID + "','Please enter the LAN ID of your working sponsor')" +
                                           " && ValidateDropDown('" + ddlReason.ClientID + "','Please make a selection for the reason')" +
                                           " && ValidateDropDown('" + ddlComponent.ClientID + "','Please make a selection for the component')" +
                                           " && ValidateDropDown('" + ddlFunding.ClientID + "','Please make a selection for the estimated funding cost')" +
                                           " && ValidateRadioButtons('" + radTPM_Yes.ClientID + "','" + radTPM_No.ClientID + "','Please select whether or not you require a technical project manager')" +
                                           " && ValidateText('" + txtStatement.ClientID + "','Please enter a statement of work')" +
                                           " && ValidateNumber('" + txtDevices.ClientID + "','Please enter a valid number of devices')" +
                                           " && ValidateNumber0('" + txtHours.ClientID + "','Please enter a valid number of hours')" +
                                           " && ValidateDate('" + txtStart.ClientID + "','Please enter a valid estimated start date')" +
                                           " && ValidateDate('" + txtEnd.ClientID + "','Please enter a valid estimated end date')" +
                                           " && ValidateDateHidden('" + txtEnd.ClientID + "','" + hdnEnd.ClientID + "','NOTE: Based on your priority, your end date cannot occur before a certain time.\\n\\n')" +
                                           " && ValidateDates('" + txtStart.ClientID + "','" + txtEnd.ClientID + "','The estimated start date must occur before the estimated end date')" +
                                           " && ValidateRemediation('" + intApproved.ToString() + "','" + ddlFunding.ClientID + "','" + radTPM_Yes.ClientID + "','" + txtHours.ClientID + "','" + divShow.ClientID + "','" + divHide.ClientID + "')" +
                                           ";");
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                StringBuilder sb = new StringBuilder(strQuestions);
                oForecast         = new Forecast(intProfile, dsn);
                oUser             = new Users(intProfile, dsn);
                oProject          = new Projects(intProfile, dsn);
                oProjectPending   = new ProjectsPending(intProfile, dsn, intEnvironment);
                oRequest          = new Requests(intProfile, dsn);
                oOrganization     = new Organizations(intProfile, dsn);
                oStatusLevel      = new StatusLevels();
                oPlatform         = new Platforms(intProfile, dsn);
                oModel            = new Models(intProfile, dsn);
                oModelsProperties = new ModelsProperties(intProfile, dsn);
                int intForecast = Int32.Parse(Request.QueryString["id"]);
                if (!IsPostBack)
                {
                    Document doc = new Document();
                    iTextSharp.text.Table oTable = new iTextSharp.text.Table(2);
                    oTable.BorderWidth = 0;
                    oTable.BorderColor = new iTextSharp.text.Color(255, 255, 255);
                    oTable.Padding     = 2;
                    oTable.Width       = 100;
                    iTextSharp.text.Font oFontHeader = new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 10, 1);
                    iTextSharp.text.Font oFontBold   = new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 8, 1);
                    iTextSharp.text.Font oFont       = new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 8, 0);
                    if (Request.QueryString["export"] != null)
                    {
                        PdfWriter.GetInstance(doc, Response.OutputStream);
                        string       strHeader = "ClearView Design Summary";
                        HeaderFooter header    = new HeaderFooter(new Phrase(strHeader, new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 6)), false);
                        header.Border    = iTextSharp.text.Rectangle.NO_BORDER;
                        header.Alignment = 2;
                        doc.Header       = header;
                        string       strFooter = DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString();
                        HeaderFooter footer    = new HeaderFooter(new Phrase(strFooter, new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 6)), false);
                        footer.Border    = iTextSharp.text.Rectangle.NO_BORDER;
                        footer.Alignment = 2;
                        doc.Footer       = footer;
                        doc.Open();
                        //iTextSharp.text.Image gif = iTextSharp.text.Image.GetInstance(Request.MapPath("~/images/nc_logo.gif"));
                        //gif.Alignment = iTextSharp.text.Image.RIGHT_ALIGN;
                        //gif.ScalePercent(50f); // change it's size
                        //doc.Add(gif);
                        Cell cell = new Cell(new Phrase("General Information", oFontHeader));
                        cell.Colspan         = 2;
                        cell.BackgroundColor = new iTextSharp.text.Color(204, 204, 204);
                        oTable.AddCell(cell);
                    }
                    DataSet ds         = oForecast.Get(intForecast);
                    int     intRequest = 0;
                    sb.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"3\" border=\"0\">");
                    sb.Append("<tr><td colspan=\"2\" class=\"header\">General Information</td></tr>");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        oTable.AddCell(new Cell(new Phrase("Requestor:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())), oFont)));
                        sb.Append("<tr><td nowrap>Requestor:</td><td width=\"100%\">");
                        sb.Append(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())));
                        sb.Append("</td></tr>");
                        oTable.AddCell(new Cell(new Phrase("Submission Date:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToLongDateString(), oFont)));
                        sb.Append("<tr><td nowrap>Submission Date:</td><td width=\"100%\">");
                        sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToLongDateString());
                        sb.Append("</td></tr>");
                        intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                    }
                    int intManager  = 0;
                    int intEngineer = 0;
                    int intLead     = 0;
                    int intProject  = oRequest.GetProjectNumber(intRequest);
                    if (intProject > 0)
                    {
                        DataSet dsProject = oProject.Get(intProject);
                        if (dsProject.Tables[0].Rows.Count > 0)
                        {
                            oTable.AddCell(new Cell(new Phrase("Project Name:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsProject.Tables[0].Rows[0]["name"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Initiative Type:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsProject.Tables[0].Rows[0]["bd"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Organization:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(oOrganization.GetName(Int32.Parse(dsProject.Tables[0].Rows[0]["organization"].ToString())), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Project Number:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsProject.Tables[0].Rows[0]["number"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Project Status:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(oStatusLevel.Name(Int32.Parse(dsProject.Tables[0].Rows[0]["status"].ToString())), oFont)));
                            sb.Append("<tr><td nowrap>Project Name:</td><td width=\"100%\">");
                            sb.Append(dsProject.Tables[0].Rows[0]["name"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Initiative Type:</td><td width=\"100%\">");
                            sb.Append(dsProject.Tables[0].Rows[0]["bd"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Organization:</td><td width=\"100%\">");
                            sb.Append(oOrganization.GetName(Int32.Parse(dsProject.Tables[0].Rows[0]["organization"].ToString())));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Project Number:</td><td width=\"100%\">");
                            sb.Append(dsProject.Tables[0].Rows[0]["number"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Project Status:</td><td width=\"100%\">");
                            sb.Append(oStatusLevel.HTML(Int32.Parse(dsProject.Tables[0].Rows[0]["status"].ToString())));
                            sb.Append("</td></tr>");
                            intManager  = Int32.Parse(dsProject.Tables[0].Rows[0]["lead"].ToString());
                            intEngineer = Int32.Parse(dsProject.Tables[0].Rows[0]["engineer"].ToString());
                            intLead     = Int32.Parse(dsProject.Tables[0].Rows[0]["technical"].ToString());
                        }
                    }
                    else
                    {
                        DataSet dsPending = oProjectPending.GetRequest(intRequest);
                        if (dsPending.Tables[0].Rows.Count > 0)
                        {
                            oTable.AddCell(new Cell(new Phrase("Project Name:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsPending.Tables[0].Rows[0]["name"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Initiative Type:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsPending.Tables[0].Rows[0]["bd"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Organization:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(oOrganization.GetName(Int32.Parse(dsPending.Tables[0].Rows[0]["organization"].ToString())), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Project Number:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsPending.Tables[0].Rows[0]["number"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Project Status:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase("PENDING", oFont)));
                            sb.Append("<tr><td nowrap>Project Name:</td><td width=\"100%\">");
                            sb.Append(dsPending.Tables[0].Rows[0]["name"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Initiative Type:</td><td width=\"100%\">");
                            sb.Append(dsPending.Tables[0].Rows[0]["bd"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Organization:</td><td width=\"100%\">");
                            sb.Append(oOrganization.GetName(Int32.Parse(dsPending.Tables[0].Rows[0]["organization"].ToString())));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Project Number:</td><td width=\"100%\">");
                            sb.Append(dsPending.Tables[0].Rows[0]["number"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Project Status:</td><td width=\"100%\" class=\"pending\">PENDING</td></tr>");
                            intManager  = Int32.Parse(dsPending.Tables[0].Rows[0]["lead"].ToString());
                            intEngineer = Int32.Parse(dsPending.Tables[0].Rows[0]["engineer"].ToString());
                            intLead     = Int32.Parse(dsPending.Tables[0].Rows[0]["technical"].ToString());
                        }
                    }
                    if (intManager > 0)
                    {
                        sb.Append("<tr><td nowrap>Project Manager:</td><td width=\"100%\">");
                        sb.Append(oUser.GetFullName(intManager));
                        sb.Append("</td></tr>");
                    }
                    else
                    {
                        sb.Append("<tr><td nowrap>Project Manager:</td><td width=\"100%\"></td></tr>");
                    }
                    if (intEngineer > 0)
                    {
                        sb.Append("<tr><td nowrap>Integration Engineer:</td><td width=\"100%\">");
                        sb.Append(oUser.GetFullName(intEngineer));
                        sb.Append("</td></tr>");
                    }
                    else
                    {
                        sb.Append("<tr><td nowrap>Integration Engineer:</td><td width=\"100%\"></td></tr>");
                    }
                    if (intLead > 0)
                    {
                        sb.Append("<tr><td nowrap>Technical Lead:</td><td width=\"100%\">");
                        sb.Append(oUser.GetFullName(intLead));
                        sb.Append("</td></tr>");
                    }
                    else
                    {
                        sb.Append("<tr><td nowrap>Technical Lead:</td><td width=\"100%\"></td></tr>");
                    }

                    oTable.AddCell(new Cell(new Phrase("Project Manager:", oFontBold)));
                    oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(intManager), oFont)));
                    oTable.AddCell(new Cell(new Phrase("Integration Engineer:", oFontBold)));
                    oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(intEngineer), oFont)));
                    oTable.AddCell(new Cell(new Phrase("Technical Lead:", oFontBold)));
                    oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(intLead), oFont)));
                    oTable.AddCell(new Cell(new Phrase(" ", oFontBold)));
                    oTable.AddCell(new Cell(new Phrase(" ", oFont)));
                    Cell cell2 = new Cell(new Phrase("Line Items", oFontHeader));
                    cell2.Colspan         = 2;
                    cell2.BackgroundColor = new iTextSharp.text.Color(204, 204, 204);
                    oTable.AddCell(cell2);
                    sb.Append("<tr><td colspan=\"2\"><hr size=\"1\" noshade /></td></tr>");
                    sb.Append("<tr><td colspan=\"2\" class=\"header\">Line Items</td></tr>");
                    sb.Append("<tr><td colspan=\"2\">");
                    ds = oForecast.GetAnswers(intForecast);
                    bool boolChange = false;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        int    intID          = Int32.Parse(dr["id"].ToString());
                        int    intPlatform    = Int32.Parse(dr["platformid"].ToString());
                        int    intClass       = Int32.Parse(dr["classid"].ToString());
                        int    intEnvir       = Int32.Parse(dr["environmentid"].ToString());
                        double dblQuantity    = double.Parse(dr["quantity"].ToString()) + double.Parse(dr["recovery_number"].ToString());
                        int    intModel       = 0;
                        int    intServerModel = oForecast.GetModelAsset(intID);
                        if (intServerModel == 0)
                        {
                            intServerModel = oForecast.GetModel(intID);
                        }
                        if (intServerModel == 0)
                        {
                            // Get the model selected in the equipment dropdown (if not server)
                            intModel = Int32.Parse(dr["modelid"].ToString());
                        }
                        double dblAmp       = 0.00;
                        double dblReplicate = 0.00;
                        string strModel     = "";
                        if (intServerModel > 0)
                        {
                            dblAmp = (double.Parse(oModelsProperties.Get(intServerModel, "amp")) * dblQuantity);
                            double.TryParse(oModelsProperties.Get(intServerModel, "replicate_times"), out dblReplicate);
                            if (intModel == 0)
                            {
                                intModel = Int32.Parse(oModelsProperties.Get(intServerModel, "modelid"));
                            }
                            strModel = oModelsProperties.Get(intServerModel, "name");
                        }
                        else if (intModel > 0)
                        {
                            strModel = oModel.Get(intModel, "name");
                        }
                        else
                        {
                            DataSet dsVendor = oForecast.GetAnswer(intID);
                            if (dsVendor.Tables[0].Rows.Count > 0 && dsVendor.Tables[0].Rows[0]["modelname"].ToString() != "")
                            {
                                dblAmp   = (double.Parse(dsVendor.Tables[0].Rows[0]["amp"].ToString()) * dblQuantity);
                                strModel = dsVendor.Tables[0].Rows[0]["modelname"].ToString();
                            }
                        }
                        if (intModel == 0)
                        {
                            strModel = "Solution Unavailable";
                        }
                        // STORAGE
                        DataSet dsStorage  = oForecast.GetStorage(intID);
                        double  dblStorage = 0.00;
                        if (dsStorage.Tables[0].Rows.Count > 0)
                        {
                            double dblHigh     = double.Parse(dsStorage.Tables[0].Rows[0]["high_total"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["high_qa"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["high_test"].ToString()) + (double.Parse(dsStorage.Tables[0].Rows[0]["high_replicated"].ToString()) * dblReplicate) + double.Parse(dsStorage.Tables[0].Rows[0]["high_ha"].ToString());
                            double dblStandard = double.Parse(dsStorage.Tables[0].Rows[0]["standard_total"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["standard_qa"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["standard_test"].ToString()) + (double.Parse(dsStorage.Tables[0].Rows[0]["standard_replicated"].ToString()) * dblReplicate) + double.Parse(dsStorage.Tables[0].Rows[0]["standard_ha"].ToString());
                            double dblLow      = double.Parse(dsStorage.Tables[0].Rows[0]["low_total"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["low_qa"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["low_test"].ToString()) + (double.Parse(dsStorage.Tables[0].Rows[0]["low_replicated"].ToString()) * dblReplicate) + double.Parse(dsStorage.Tables[0].Rows[0]["low_ha"].ToString());
                            dblStorage = dblHigh + dblStandard + dblLow;
                        }
                        sb.Append("<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color:");
                        sb.Append(boolChange ? "#FFFFFF" : "#F6F6F6");
                        sb.Append("\">");
                        sb.Append("<tr><td>");
                        sb.Append("<table width=\"100%\" cellpadding=\"5\" cellspacing=\"2\" border=\"0\">");
                        sb.Append("<tr><td valign=\"top\" nowrap>Nickname:</td><td>");
                        sb.Append(dr["name"].ToString());
                        sb.Append("</td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>Platform:</td><td>");
                        sb.Append(oPlatform.GetName(intPlatform));
                        sb.Append("</td></tr>");
                        oTable.AddCell(new Cell(new Phrase("Nickname:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dr["name"].ToString(), oFont)));
                        oTable.AddCell(new Cell(new Phrase("Platform:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(oPlatform.GetName(intPlatform), oFont)));
                        oTable.AddCell(new Cell(new Phrase("Model:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(strModel, oFont)));
                        oTable.AddCell(new Cell(new Phrase("Commitment Date:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase((dr["implementation"].ToString() == "" ? "" : DateTime.Parse(dr["implementation"].ToString()).ToShortDateString()), oFont)));
                        oTable.AddCell(new Cell(new Phrase("Quantity:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblQuantity.ToString(), oFont)));
                        string strPDF = oModel.Get(intModel, "pdf");
                        sb.Append("<tr><td valign=\"top\" nowrap>Model:</td><td width=\"100%\">");
                        sb.Append(strPDF == "" ? strModel : "<a href=\"javascript:void(0);\" onclick=\"OpenNewWindowMAX('" + strPDF.Replace("\\", "\\\\") + "');\">" + strModel + "</a>");
                        sb.Append("</td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>Commitment Date:</td><td width=\"100%\">");
                        sb.Append(dr["implementation"].ToString() == "" ? "" : DateTime.Parse(dr["implementation"].ToString()).ToShortDateString());
                        sb.Append("</td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>Quantity:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_quantity.aspx?id=");
                        sb.Append(intID.ToString());
                        sb.Append("',275,200);\">");
                        sb.Append(dblQuantity.ToString());
                        sb.Append("</a></td></tr>");
                        double  dblA = 0.00;
                        DataSet dsA  = oForecast.GetAcquisitions(intModel, 1);
                        foreach (DataRow drA in dsA.Tables[0].Rows)
                        {
                            dblA += double.Parse(drA["cost"].ToString());
                        }
                        sb.Append("<tr><td valign=\"top\" nowrap>Acquisition Costs:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_acquisition.aspx?id=");
                        sb.Append(intID.ToString());
                        sb.Append("',400,300);\">$");
                        sb.Append(dblA.ToString("N"));
                        sb.Append("</a></td></tr>");
                        oTable.AddCell(new Cell(new Phrase("Acquisition Costs:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblA.ToString("N"), oFont)));
                        double  dblO = 0.00;
                        DataSet dsO  = oForecast.GetOperations(intModel, 1);
                        foreach (DataRow drO in dsO.Tables[0].Rows)
                        {
                            dblO += double.Parse(drO["cost"].ToString());
                        }
                        oTable.AddCell(new Cell(new Phrase("Operational Costs:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblO.ToString("N"), oFont)));
                        oTable.AddCell(new Cell(new Phrase("Storage:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblStorage.ToString("N") + " GB", oFont)));
                        oTable.AddCell(new Cell(new Phrase("AMPs:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblAmp.ToString("N") + " AMPs", oFont)));
                        sb.Append("<tr><td valign=\"top\" nowrap>Operational Costs:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_operational.aspx?id=");
                        sb.Append(intID.ToString());
                        sb.Append("',400,300);\">$");
                        sb.Append(dblO.ToString("N"));
                        sb.Append("</a></td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>Storage:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_storage.aspx?id=");
                        sb.Append(intID.ToString());
                        sb.Append("',650,200);\">");
                        sb.Append(dblStorage.ToString("N"));
                        sb.Append(" GB</a></td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>AMPs:</td><td width=\"100%\">");
                        sb.Append(dblAmp.ToString("N"));
                        sb.Append("</td></tr>");
                        if (Request.QueryString["checked"] != null)
                        {
                            sb.Append("<tr><td valign=\"top\" colspan=\"2\"><b>Questions & Responses</b></td></tr>");
                            DataSet dsQuestions = oForecast.GetQuestionPlatform(intPlatform, intClass, intEnvir);
                            foreach (DataRow drQuestion in dsQuestions.Tables[0].Rows)
                            {
                                string  strResponse    = "";
                                string  strResponsePDF = "";
                                int     intQuestion    = Int32.Parse(drQuestion["id"].ToString());
                                DataSet dsAnswers      = oForecast.GetAnswerPlatform(intID, intQuestion);
                                foreach (DataRow drAnswer in dsAnswers.Tables[0].Rows)
                                {
                                    strResponse += "<tr><td valign=\"top\"></td><td> " + oForecast.GetResponse(Int32.Parse(drAnswer["responseid"].ToString()), "response") + "</td></tr>";
                                    if (strResponsePDF != "")
                                    {
                                        strResponsePDF += ", ";
                                    }
                                    strResponsePDF += oForecast.GetResponse(Int32.Parse(drAnswer["responseid"].ToString()), "response");
                                }
                                if (strResponse != "")
                                {
                                    sb.Append("<tr><td valign=\"top\" colspan=\"2\"><table cellpadding=\"1\" cellspacing=\"1\" border=\"0\">");
                                    sb.Append("<tr><td valign=\"top\"><img src=\"/images/help.gif\" align=\"absmiddle\" border=\"0\"/></td><td>");
                                    sb.Append(drQuestion["question"].ToString());
                                    sb.Append("</td></tr>");
                                    Cell oCellQ = new Cell(new Phrase(drQuestion["question"].ToString(), oFontBold));
                                    oCellQ.Colspan = 2;
                                    oTable.AddCell(oCellQ);
                                    Cell oCellA = new Cell(new Phrase(strResponsePDF, oFont));
                                    oCellA.Colspan = 2;
                                    oTable.AddCell(oCellA);
                                    sb.Append(strResponse);
                                    sb.Append("</table></td></tr>");
                                }
                            }
                        }
                        sb.Append("</table></td></tr>");
                        Cell oCellD = new Cell(new Phrase("", oFont));
                        oCellD.Colspan         = 2;
                        oCellD.BackgroundColor = new iTextSharp.text.Color(100, 100, 100);
                        oTable.AddCell(oCellD);
                        sb.Append("<tr height=\"1\"><td colspan=\"2\" style=\"border-bottom:dashed 1px #CCCCCC\"><img src=\"/images/spacer.gif\" border=\"0\" width=\"1\" height=\"1\" /></td></tr>");
                        sb.Append("</table>");
                        boolChange = !boolChange;
                    }
                    sb.Append("</td></tr>");
                    chkQuestions.Checked = (Request.QueryString["checked"] != null);
                    chkQuestions.Attributes.Add("onclick", "WaitDDL('" + divWait.ClientID + "');");
                    if (Request.QueryString["export"] != null)
                    {
                        doc.Add(oTable);
                        doc.Close();
                        Response.ContentType = "application/pdf";
                        Response.AddHeader("Content-Disposition", "attachment; filename=export.pdf");
                        Response.End();
                        Response.Flush();
                    }
                }

                strQuestions = sb.ToString();
            }
        }