Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);

            oRequest         = new Requests(0, dsn);
            oResourceRequest = new ResourceRequest(0, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oService         = new Services(0, dsn);
            oUser            = new Users(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oApplication     = new Applications(intProfile, dsn);
            oProject         = new Projects(intProfile, dsn);
            oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
            oVariable        = new Variables(intEnvironment);
            oPage            = new Pages(intProfile, dsn);
            oServiceEditor   = new ServiceEditor(intProfile, dsnServiceEditor);

            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }

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

            getReturningRequestDetails();

            btnSave.Attributes.Add("onclick", "return ValidateText('" + txtComments.ClientID + "','Please enter comment for returning request') && AlertMessage('This action might take a few seconds to complete...\\n\\nPlease be patient and wait for the window to finish processing...') && ProcessButton(this);");

            //btnSave.Attributes.Add("onclick", "parent.HidePanel();");
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage            = new Pages(intProfile, dsn);
     oRequestItem     = new RequestItems(intProfile, dsn);
     oServiceRequest  = new ServiceRequests(intProfile, dsn);
     oApplication     = new Applications(intProfile, dsn);
     oVariable        = new Variables(intEnvironment);
     oRequestField    = new RequestFields(intProfile, dsn);
     oService         = new Services(intProfile, dsn);
     oUser            = new Users(intProfile, dsn);
     oCustomized      = new Customized(intProfile, dsn);
     oRequest         = new Requests(intProfile, dsn);
     oResourceRequest = new ResourceRequest(intProfile, dsn);
     oProject         = new Projects(intProfile, dsn);
     oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
     {
         LoadValues();
         LoadRequest();
         btnNext.Attributes.Add("onclick", "return ValidateHidden('" + hdnExecutive.ClientID + "','" + txtExecutive.ClientID + "','Please enter the LAN ID of your executive sponsor')" +
                                " && ValidateHidden('" + hdnWorking.ClientID + "','" + txtWorking.ClientID + "','Please enter the LAN ID of your working sponsor')" +
                                " && ValidateText('" + txtStatement.ClientID + "','Please enter a statement of work')" +
                                " && 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')" +
                                ";");
         txtExecutive.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divExecutive.ClientID + "','" + lstExecutive.ClientID + "','" + hdnExecutive.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstExecutive.Attributes.Add("ondblclick", "AJAXClickRow();");
         txtWorking.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divWorking.ClientID + "','" + lstWorking.ClientID + "','" + hdnWorking.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstWorking.Attributes.Add("ondblclick", "AJAXClickRow();");
         imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
         imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
         // Custom Loads
         int    intItem        = Int32.Parse(lblItem.Text);
         int    intApp         = oRequestItem.GetItemApplication(intItem);
         string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
         if (strDeliverable != "")
         {
             panDeliverable.Visible = true;
             btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
         }
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to cancel this service request?');");
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage            = new Pages(intProfile, dsn);
     oRequestItem     = new RequestItems(intProfile, dsn);
     oApplication     = new Applications(intProfile, dsn);
     oVariable        = new Variables(intEnvironment);
     oRequestField    = new RequestFields(intProfile, dsn);
     oService         = new Services(intProfile, dsn);
     oCustomized      = new Customized(intProfile, dsn);
     oRequest         = new Requests(intProfile, dsn);
     oProject         = new Projects(intProfile, dsn);
     oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
     oServiceRequest  = new ServiceRequests(intProfile, dsn);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
     {
         LoadValues();
         // Custom Loads
         int    intItem        = Int32.Parse(lblItem.Text);
         int    intApp         = oRequestItem.GetItemApplication(intItem);
         string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
         if (strDeliverable != "")
         {
             panDeliverable.Visible = true;
             btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
         }
     }
     ddlCluster.Attributes.Add("onchange", "ResetDiv(null);SwapDivDDL(this,null,'" + divClusterYesGroup.ClientID + "','" + divClusterNo.ClientID + "',null);");
     ddlClusterYesSQLGroup.Attributes.Add("onchange", "SwapDivDDL(this,'" + divClusterYesGroupNew.ClientID + "',null,'" + divClusterYesGroupExisting.ClientID + "',null);");
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
     btnNext.Attributes.Add("onclick", "return ValidateText('" + txtServerName.ClientID + "','Please enter the server name')" +
                            " && ValidateDropDown('" + ddlOS.ClientID + "','Please select the operating system')" +
                            " && ValidateDropDown('" + ddlMaintenance.ClientID + "','Please select the maintenance window')" +
                            " && ValidateDropDown('" + ddlCurrent.ClientID + "','Please select if the server currently has SAN')" +
                            " && ValidateDropDown('" + ddlType.ClientID + "','Please select the server type')" +
                            " && ValidateDropDown('" + ddlDR.ClientID + "','Please select the DR options')" +
                            " && ValidateDropDown('" + ddlPerformance.ClientID + "','Please select the performance type')" +
                            " && ValidateDropDown('" + ddlChange.ClientID + "','Please select if you have scheduled a change')" +
                            " && ValidateDropDown('" + ddlCluster.ClientID + "','Please select if the server is part of a cluster')" +
                            " && EnsureStorage3rd('" + ddlCluster.ClientID + "','" + ddlClusterYesSQLGroup.ClientID + "','" + txtClusterYesGroupExisting.ClientID + "','" + ddlClusterYesGroupExisting.ClientID + "','" + txtClusterYesGroupExistingFileSystem.ClientID + "','" + chkClusterYesGroupNewNetwork.ClientID + "','" + txtClusterYesGroupNewNetwork.ClientID + "','" + chkClusterYesGroupNewIP.ClientID + "','" + txtClusterYesGroupNewIP.ClientID + "','" + ddlClusterNo.ClientID + "','" + txtClusterNo.ClientID + "')" +
                            " && ValidateNumber0('" + txtAdditional.ClientID + "','Please enter the amount of ADDITIONAL storage to be added')" +
                            " && ValidateText('" + txtDescription.ClientID + "','Please enter a description of the work to be performed')" +
                            ";");
     imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
 }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage            = new Pages(intProfile, dsn);
     oRequestItem     = new RequestItems(intProfile, dsn);
     oServiceRequest  = new ServiceRequests(intProfile, dsn);
     oApplication     = new Applications(intProfile, dsn);
     oVariable        = new Variables(intEnvironment);
     oRequestField    = new RequestFields(intProfile, dsn);
     oService         = new Services(intProfile, dsn);
     oUser            = new Users(intProfile, dsn);
     oCustomized      = new Customized(intProfile, dsn);
     oRequest         = new Requests(intProfile, dsn);
     oResourceRequest = new ResourceRequest(intProfile, dsn);
     oProject         = new Projects(intProfile, dsn);
     oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
     {
         LoadValues();
         LoadRequest();
         imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
         imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
         // Custom Loads
         int    intItem        = Int32.Parse(lblItem.Text);
         int    intApp         = oRequestItem.GetItemApplication(intItem);
         string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
         if (strDeliverable != "")
         {
             panDeliverable.Visible = true;
             btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
         }
         int intWorkingDays = oApplication.GetLead(intApp, 3);
         if (intWorkingDays > 0)
         {
             oApplication.AssignPriority(intApp, radPriority, lblDeliverable.ClientID, txtEnd.ClientID, hdnEnd.ClientID);
             lblDeliverable.Text = intWorkingDays.ToString();
             txtEnd.Text         = DateTime.Today.AddDays(intWorkingDays).ToShortDateString();
             hdnEnd.Value        = DateTime.Today.AddDays(intWorkingDays).ToShortDateString();
         }
         btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + Request.QueryString["rid"] + "');");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
 }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage            = new Pages(intProfile, dsn);
     oRequestItem     = new RequestItems(intProfile, dsn);
     oApplication     = new Applications(intProfile, dsn);
     oVariable        = new Variables(intEnvironment);
     oRequestField    = new RequestFields(intProfile, dsn);
     oService         = new Services(intProfile, dsn);
     oCustomized      = new Customized(intProfile, dsn);
     oRequest         = new Requests(intProfile, dsn);
     oProject         = new Projects(intProfile, dsn);
     oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
     {
         LoadValues();
         txtWorking.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divWorking.ClientID + "','" + lstWorking.ClientID + "','" + hdnWorking.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstWorking.Attributes.Add("ondblclick", "AJAXClickRow();");
         imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
         imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
         // Custom Loads
         int intItem = Int32.Parse(lblItem.Text);
         int intApp  = oRequestItem.GetItemApplication(intItem);
         LoadRequest(intApp);
         string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
         if (strDeliverable != "")
         {
             panDeliverable.Visible = true;
             btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
         }
         oApplication.AssignPriority(intApp, radPriority, lblDeliverable.ClientID, txtEnd.ClientID, hdnEnd.ClientID);
         int intWorking = oApplication.GetLead(intApp, 3);
         lblDeliverable.Text = intWorking.ToString();
         txtEnd.Text         = DateTime.Today.AddDays(intWorking).ToShortDateString();
         hdnEnd.Value        = DateTime.Today.AddDays(intWorking).ToShortDateString();
         btnClose.Attributes.Add("onclick", "return CloseWindow();");
         btnBack2.Attributes.Add("onclick", "ShowHideDiv('" + divShow.ClientID + "','inline');ShowHideDiv('" + divHide.ClientID + "','none');return false;");
         btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + Request.QueryString["rid"] + "');");
         imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
 }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage            = new Pages(intProfile, dsn);
     oRequestItem     = new RequestItems(intProfile, dsn);
     oServiceRequest  = new ServiceRequests(intProfile, dsn);
     oApplication     = new Applications(intProfile, dsn);
     oVariable        = new Variables(intEnvironment);
     oRequestField    = new RequestFields(intProfile, dsn);
     oService         = new Services(intProfile, dsn);
     oUser            = new Users(intProfile, dsn);
     oCustomized      = new Customized(intProfile, dsn);
     oRequest         = new Requests(intProfile, dsn);
     oResourceRequest = new ResourceRequest(intProfile, dsn);
     oProject         = new Projects(intProfile, dsn);
     oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
     {
         LoadValues();
         imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
         imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
         // Custom Loads
         int    intItem        = Int32.Parse(lblItem.Text);
         int    intApp         = oRequestItem.GetItemApplication(intItem);
         string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
         if (strDeliverable != "")
         {
             panDeliverable.Visible = true;
             btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
         }
         btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + Request.QueryString["rid"] + "');");
         btnNext.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                " && ValidateText('" + txtStatement.ClientID + "','Please enter a statement of work')" +
                                " && 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')" +
                                ";");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
 }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage            = new Pages(intProfile, dsn);
     oRequestItem     = new RequestItems(intProfile, dsn);
     oApplication     = new Applications(intProfile, dsn);
     oVariable        = new Variables(intEnvironment);
     oRequestField    = new RequestFields(intProfile, dsn);
     oService         = new Services(intProfile, dsn);
     oCustomized      = new Customized(intProfile, dsn);
     oRequest         = new Requests(intProfile, dsn);
     oProject         = new Projects(intProfile, dsn);
     oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
     {
         LoadValues();
         txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divManager.ClientID + "','" + lstManager.ClientID + "','" + hdnLead.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstManager.Attributes.Add("ondblclick", "AJAXClickRow();");
         txtEngineer.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divEngineer.ClientID + "','" + lstEngineer.ClientID + "','" + hdnTechnical.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstEngineer.Attributes.Add("ondblclick", "AJAXClickRow();");
         imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
         imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
         chkExpedite_Yes.Attributes.Add("onclick", "Expedite(this, '" + chkExpedite_No.ClientID + "');");
         // Custom Loads
         int intItem = Int32.Parse(lblItem.Text);
         int intApp  = oRequestItem.GetItemApplication(intItem);
         LoadRequest(intItem, intApp);
         string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
         if (strDeliverable != "")
         {
             panDeliverable.Visible = true;
             btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
         }
         btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + Request.QueryString["rid"] + "');");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
 }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage            = new Pages(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oRequestField    = new RequestFields(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oCustomized      = new Customized(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oProject         = new Projects(intProfile, dsn);
            oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
            oCustom          = new Customized(intProfile, dsn);
            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }
            if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
            {
                int intRequest = Int32.Parse(Request.QueryString["rid"]);
                LoadValues();
                // Vijay -- Added Validation Check
                btnNext.Attributes.Add("onclick", "return ValidateDates('" + txtStart.ClientID + "','" + txtEnd.ClientID + "','The estimated start date must occur before the estimated end date');");
                imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
                imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");

                // Vijay -- Added onclick attributes to followup and date engaged fields
                imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDateEngaged.ClientID + "');");
                imgFollowUpDate.Attributes.Add("onclick", "return ShowCalendar('" + txtFollowupDate.ClientID + "');");


                // Custom Loads
                int    intItem        = Int32.Parse(lblItem.Text);
                int    intApp         = oRequestItem.GetItemApplication(intItem);
                string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                if (strDeliverable != "")
                {
                    panDeliverable.Visible = true;
                    btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
                }
                int intNumber = Int32.Parse(lblNumber.Text);
                rptAssets.DataSource = oCustom.GetTechAssets(intRequest, intItem, intNumber);
                rptAssets.DataBind();
                rptResource.DataSource = oCustom.GetResourceAssignments(intRequest, intItem, intNumber);
                rptResource.DataBind();
                lblNoAsset.Visible = rptAssets.Items.Count == 0;
                lblNoRes.Visible   = rptResource.Items.Count == 0;
                foreach (RepeaterItem ri in rptAssets.Items)
                {
                    Panel      panEdit   = (Panel)ri.FindControl("panEditable");
                    LinkButton btnDelete = (LinkButton)panEdit.FindControl("btnDelete");

                    btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this asset?');");
                    panEdit.Visible = true;
                }
                if (IsPostBack)
                {
                    int intInvestigatedBy = 0;
                    if (Request.Form[hdnInvestigatedBy.UniqueID] != "")
                    {
                        intInvestigatedBy = Int32.Parse(Request.Form[hdnInvestigatedBy.UniqueID]);
                    }
                    int intIDCSPOC = 0;
                    if (Request.Form[hdnIDCSPOC.UniqueID] != "")
                    {
                        intIDCSPOC = Int32.Parse(Request.Form[hdnIDCSPOC.UniqueID]);
                    }
                    oCustomized.AddIDCDetails(intRequest, intItem, intNumber, drpInvestigated.SelectedItem.Text, intInvestigatedBy, txtFollowupDate.Text, txtDateEngaged.Text, drpPhase.SelectedItem.Text, drpEffortSize.SelectedItem.Text, drpInvolvement.SelectedItem.Text, drpEIT.SelectedItem.Text, drpProjectClass.SelectedItem.Text, drpEnterprise.SelectedItem.Text, drpNoInvolve.SelectedItem.Text, intIDCSPOC, txtComment.Text);
                    try
                    {
                        oRequest.UpdateStartDate(intRequest, DateTime.Parse(txtStart.Text));
                        oRequest.UpdateEndDate(intRequest, DateTime.Parse(txtEnd.Text));
                    }
                    catch { }
                }
                else
                {
                    DataSet dsInvestigation = oCustom.GetIDCDetails(intRequest, intItem, intNumber);
                    if (dsInvestigation.Tables[0].Rows.Count > 0)
                    {
                        int intSPOC = 0;
                        if (dsInvestigation.Tables[0].Rows[0]["idc_spoc"].ToString() != "0")
                        {
                            intSPOC         = Int32.Parse(dsInvestigation.Tables[0].Rows[0]["idc_spoc"].ToString());
                            txtIDCSPOC.Text = oUser.GetFullName(intSPOC) + " (" + oUser.GetName(intSPOC) + ")";
                        }
                        hdnIDCSPOC.Value = intSPOC.ToString();
                        int intInvestigatedBy = 0;
                        if (dsInvestigation.Tables[0].Rows[0]["investigated_by"].ToString() != "0")
                        {
                            intInvestigatedBy      = Int32.Parse(dsInvestigation.Tables[0].Rows[0]["investigated_by"].ToString());
                            txtInvestigatedBy.Text = oUser.GetFullName(intInvestigatedBy) + " (" + oUser.GetName(intInvestigatedBy) + ")";
                        }
                        hdnInvestigatedBy.Value       = intInvestigatedBy.ToString();
                        drpInvestigated.SelectedValue = dsInvestigation.Tables[0].Rows[0]["investigated"].ToString();
                        if (dsInvestigation.Tables[0].Rows[0]["followup_date"].ToString() != "")
                        {
                            txtFollowupDate.Text = DateTime.Parse(dsInvestigation.Tables[0].Rows[0]["followup_date"].ToString()).ToShortDateString();
                        }
                        if (dsInvestigation.Tables[0].Rows[0]["date_engaged"].ToString() != "")
                        {
                            txtDateEngaged.Text = DateTime.Parse(dsInvestigation.Tables[0].Rows[0]["date_engaged"].ToString()).ToShortDateString();
                        }
                        drpPhase.SelectedValue       = dsInvestigation.Tables[0].Rows[0]["phase_engaged"].ToString();
                        drpEffortSize.SelectedValue  = dsInvestigation.Tables[0].Rows[0]["effort_size"].ToString();
                        drpInvolvement.SelectedValue = dsInvestigation.Tables[0].Rows[0]["involvement"].ToString();
                        if (drpInvolvement.SelectedItem.Value == "No")
                        {
                            divInvolvement.Style["display"] = "inline";
                        }
                        drpEIT.SelectedValue          = dsInvestigation.Tables[0].Rows[0]["eit_testing"].ToString();
                        drpProjectClass.SelectedValue = dsInvestigation.Tables[0].Rows[0]["project_class"].ToString();
                        drpEnterprise.SelectedValue   = dsInvestigation.Tables[0].Rows[0]["enterprise_release"].ToString();
                        drpNoInvolve.SelectedValue    = dsInvestigation.Tables[0].Rows[0]["no_involve"].ToString();
                        txtComment.Text = dsInvestigation.Tables[0].Rows[0]["comments"].ToString();
                    }
                }



                foreach (RepeaterItem ri in rptResource.Items)
                {
                    int   id = Int32.Parse(((Label)ri.FindControl("lblResID")).Text);
                    Label lblResourceType  = (Label)ri.FindControl("lblResourceType");
                    Label lblRequestedDate = (Label)ri.FindControl("lblRequestedDate");
                    Label lblFulfillDate   = (Label)ri.FindControl("lblFulfillDate");
                    lblRequestedDate.Text = Convert.ToDateTime(lblRequestedDate.Text).ToShortDateString();
                    lblFulfillDate.Text   = Convert.ToDateTime(lblFulfillDate.Text).ToShortDateString();
                    lblResourceType.Text  = oCustom.GetResourceTypeName(id, "name");
                    Panel      panEdit   = (Panel)ri.FindControl("panEditable");
                    LinkButton btnDelete = (LinkButton)panEdit.FindControl("btnDelete");
                    btnDelete.Attributes.Add("onclick", " return confirm('Are you sure you want to delete this resource?') ;");
                    panEdit.Visible = true;
                }
                btnAddRes.Attributes.Add("onclick", "return EditResource('" + intRequest + "','" + intItem + "','" + intNumber + "','0');");
                btnAddAsset.Attributes.Add("onclick", "return EditAsset('" + intRequest + "','" + intItem + "','" + intNumber + "','0');");
            }
            txtInvestigatedBy.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'200','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnInvestigatedBy.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstAJAX.Attributes.Add("ondblclick", "AJAXClickRow();");
            txtIDCSPOC.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'200','195','" + divIDCSPOC.ClientID + "','" + lstIDCSPOC.ClientID + "','" + hdnIDCSPOC.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstIDCSPOC.Attributes.Add("ondblclick", "AJAXClickRow();");
            drpInvolvement.Attributes.Add("onchange", "ShowInvolvementReason(this,'" + divInvolvement.ClientID + "');");
            btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to cancel this service request?');");
        }
Ejemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = "/admin/projects_pending.aspx";
     Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
     if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
     {
         intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
     }
     else
     {
         Response.Redirect("/admin/login.aspx");
     }
     oProject        = new Projects(intProfile, dsn);
     oProjectNumber  = new ProjectNumber(intProfile, dsn);
     oRequest        = new Requests(intProfile, dsn);
     oRequestItem    = new RequestItems(intProfile, dsn);
     oService        = new Services(intProfile, dsn);
     oProjectPending = new ProjectsPending(intProfile, dsn, intEnvironment);
     oOrganization   = new Organizations(intProfile, dsn);
     oDocument       = new Documents(intProfile, dsn);
     oUser           = new Users(intProfile, dsn);
     oForecast       = new Forecast(intProfile, dsn);
     oServiceRequest = new ServiceRequests(intProfile, dsn);
     if (!IsPostBack)
     {
         if (Request.QueryString["rid"] != null && Request.QueryString["rid"] != "")
         {
             // Process Service Requests
             int     intRequest = Int32.Parse(Request.QueryString["rid"]);
             DataSet dsForm     = oRequestItem.GetForms(intRequest);
             foreach (DataRow drForm in dsForm.Tables[0].Rows)
             {
                 if (drForm["done"].ToString() == "0")
                 {
                     int    intItem    = Int32.Parse(drForm["itemid"].ToString());
                     int    intNumber  = Int32.Parse(drForm["number"].ToString());
                     int    intService = Int32.Parse(drForm["serviceid"].ToString());
                     string strPath    = oService.Get(intService, "cp_path");
                     if (strPath.Trim() == "")
                     {
                         // For now, bypass
                         oRequestItem.UpdateFormDone(intRequest, intItem, intNumber, 1);
                     }
                     else
                     {
                         Control oControl = (Control)LoadControl(strPath);
                         PHcp.Controls.Add(oControl);
                     }
                 }
             }
             panPH.Visible = true;
         }
         else if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
         {
             DataSet ds         = oProjectPending.Get(Int32.Parse(Request.QueryString["id"]));
             int     intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
             if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "")
             {
                 int intProject = Int32.Parse(Request.QueryString["pid"]);
                 if (intProject > 0)
                 {
                     // Process Design Builder
                     DataSet dsForecast = oForecast.GetRequest(intRequest);
                     if (dsForecast.Tables[0].Rows.Count > 0)
                     {
                         int             intForecast      = Int32.Parse(dsForecast.Tables[0].Rows[0]["id"].ToString());
                         DataSet         dsDesigns        = oForecast.GetAnswers(intForecast);
                         OnDemandTasks   oOnDemandTasks   = new OnDemandTasks(0, dsn);
                         ResourceRequest oResourceRequest = new ResourceRequest(0, dsn);
                         foreach (DataRow drDesign in dsDesigns.Tables[0].Rows)
                         {
                             int intDesign        = Int32.Parse(drDesign["id"].ToString());
                             int intDesignRequest = 0;
                             if (Int32.TryParse(oForecast.GetAnswer(intDesign, "requestid"), out intDesignRequest) == true)
                             {
                                 if (intDesignRequest > 0)
                                 {
                                     // Update the REQUESTID in CV_FORECAST_ANSWERS with the new project correlation
                                     oRequest.Update(intDesignRequest, intProject);
                                 }
                             }
                             if (oForecast.CanAutoProvision(intDesign) == false)
                             {
                                 // Need to add a builder
                                 int     intImplementorD = 0;
                                 DataSet dsResourceD     = oResourceRequest.GetProjectItem(intProject, intImplementorDistributed);
                                 if (dsResourceD.Tables[0].Rows.Count > 0)
                                 {
                                     intImplementorD = Int32.Parse(dsResourceD.Tables[0].Rows[0]["userid"].ToString());
                                 }
                                 int     intImplementorM = 0;
                                 DataSet dsResourceM     = oResourceRequest.GetProjectItem(intProject, intImplementorMidrange);
                                 if (dsResourceM.Tables[0].Rows.Count > 0)
                                 {
                                     intImplementorM = Int32.Parse(dsResourceM.Tables[0].Rows[0]["userid"].ToString());
                                 }
                                 if (oForecast.GetPlatformDistributedForecast(intDesign, intWorkstationPlatform) == true)
                                 {
                                     if (intImplementorD > 0)
                                     {
                                         int intNextNumber       = oResourceRequest.GetNumber(intRequest);
                                         int intResourceParent   = oResourceRequest.Add(intRequest, -1, -1, intNextNumber, "Provisioning Task (Distributed)", 0, 6.00, 2, 1, 1, 1);
                                         int intResourceWorkflow = oResourceRequest.AddWorkflow(intResourceParent, 0, "Provisioning Task (Distributed)", intImplementorD, 0, 6.00, 2, 0);
                                         oOnDemandTasks.AddPending(intDesign, intResourceWorkflow);
                                         oResourceRequest.UpdateAssignedBy(intResourceParent, -999);
                                     }
                                     else
                                     {
                                         // Submit for assignment
                                         if (oServiceRequest.Get(intRequest, "requestid") == "")
                                         {
                                             oServiceRequest.Add(intRequest, 1, 1);
                                         }
                                         int intResource = oServiceRequest.AddRequest(intRequest, intImplementorDistributed, intImplementorDistributedService, 0, 0.00, 2, 1, dsnServiceEditor);
                                         if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false)
                                         {
                                             oServiceRequest.NotifyTeamLead(intImplementorDistributed, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0);
                                         }
                                     }
                                 }
                                 if (oForecast.GetPlatformMidrangeForecast(intDesign) == true)
                                 {
                                     if (intImplementorM > 0)
                                     {
                                         int intNextNumber       = oResourceRequest.GetNumber(intRequest);
                                         int intResourceParent   = oResourceRequest.Add(intRequest, -1, -1, intNextNumber, "Provisioning Task (Midrange)", 0, 6.00, 2, 1, 1, 1);
                                         int intResourceWorkflow = oResourceRequest.AddWorkflow(intResourceParent, 0, "Provisioning Task (Midrange)", intImplementorM, 0, 6.00, 2, 0);
                                         oOnDemandTasks.AddPending(intDesign, intResourceWorkflow);
                                         oResourceRequest.UpdateAssignedBy(intResourceParent, -999);
                                     }
                                     else
                                     {
                                         // Submit for assignment
                                         if (oServiceRequest.Get(intRequest, "requestid") == "")
                                         {
                                             oServiceRequest.Add(intRequest, 1, 1);
                                         }
                                         int intResource = oServiceRequest.AddRequest(intRequest, intImplementorMidrange, intImplementorMidrangeService, 0, 0.00, 2, 1, dsnServiceEditor);
                                         if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false)
                                         {
                                             oServiceRequest.NotifyTeamLead(intImplementorMidrange, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 oRequest.Update(intRequest, intProject);
                 oDocument.Update(intRequest, intProject);
                 oProjectPending.Approve(Int32.Parse(Request.QueryString["id"]));
                 if (intProject == 0)
                 {
                     oServiceRequest.Update(intRequest, ds.Tables[0].Rows[0]["name"].ToString());
                 }
                 Response.Redirect(Request.Path + "?rid=" + intRequest.ToString());
             }
             else
             {
                 if (Request.QueryString["reject"] != null)
                 {
                     panReject.Visible = true;
                 }
                 else
                 {
                     strProject = LoadProject(0, ds.Tables[0].Rows[0], intRequest, true);
                     btnView.Attributes.Add("onclick", "return ShowServiceRequests('" + intRequest.ToString() + "');");
                     btnViewDesigns.Attributes.Add("onclick", "return ShowDesigns('" + intRequest.ToString() + "');");
                     if (Request.QueryString["c"] != null && Request.QueryString["c"] != "")
                     {
                         panCompare.Visible = true;
                         string[] strProjects;
                         char[]   strSplit = { ' ' };
                         strProjects = Request.QueryString["c"].Split(strSplit);
                         bool boolOther = false;
                         for (int jj = 0; jj < strProjects.Length; jj++)
                         {
                             if (strProjects[jj].Trim() != "")
                             {
                                 TableRow  oRow  = new TableRow();
                                 TableCell oCell = new TableCell();
                                 oCell.Text = strProject;
                                 oRow.Cells.Add(oCell);
                                 oCell = new TableCell();
                                 HyperLink oCheck = new HyperLink();
                                 oCheck.ImageUrl    = "/images/bigCheck.gif";
                                 oCheck.ToolTip     = "Click to Assign";
                                 oCheck.NavigateUrl = Request.Path + "?id=" + Request.QueryString["id"] + "&pid=" + strProjects[jj];
                                 oCheck.Attributes.Add("onclick", "return confirm('Are you sure you want to assign this project?');");
                                 oCell.Controls.Add(oCheck);
                                 oRow.Cells.Add(oCell);
                                 oCell      = new TableCell();
                                 oCell.Text = LoadProject(Int32.Parse(strProjects[jj]), null, 0, false);
                                 if (boolOther == true)
                                 {
                                     oRow.Attributes.Add("bgcolor", "#EFEFEF");
                                 }
                                 boolOther = !boolOther;
                                 oRow.Cells.Add(oCell);
                                 tblCompare.Rows.Add(oRow);
                             }
                         }
                     }
                     else
                     {
                         panView.Visible = true;
                         LoadList();
                     }
                 }
             }
         }
         else
         {
             panAll.Visible = true;
             DataSet ds = oProjectPending.Gets();
             rptView.DataSource = ds;
             rptView.DataBind();
         }
     }
     btnCreateProject.Attributes.Add("onclick", "return confirm('Are you sure you want to create this PROJECT?');");
     btnCreateTask.Attributes.Add("onclick", "return confirm('Are you sure you want to create this TASK?');");
     btnCreateTask.Enabled = false;
     btnRejectConfirm.Attributes.Add("onclick", "return confirm('Are you sure you want to reject this project / task?');");
 }
        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);
                                }
                            }
                        }
                    }
                }
            }
Ejemplo n.º 11
0
        private void LoopRepeater(string _sort, int _start)
        {
            //DataSet ds = oForecast.Gets();
            DataSet ds        = oDesign.Gets();
            double  dblCount1 = 0;

            DataColumn dc1 = new DataColumn("implementation", System.Type.GetType("System.String"));

            ds.Tables[0].Columns.Add(dc1);
            DataColumn dc2 = new DataColumn("quantity", System.Type.GetType("System.Int32"));

            ds.Tables[0].Columns.Add(dc2);
            DataColumn dc3 = new DataColumn("amp", System.Type.GetType("System.Double"));

            ds.Tables[0].Columns.Add(dc3);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int intForecast = Int32.Parse(dr["id"].ToString());
                //DataSet dsAnswers = oForecast.GetAnswers(intForecast);
                DataSet  dsAnswers = oDesign.Gets(intForecast);
                DateTime _date     = DateTime.MaxValue;
                foreach (DataRow drAnswer in dsAnswers.Tables[0].Rows)
                {
                    //bool boolOverride = (dr["override"].ToString() == "1");
                    if (drAnswer["commitment"].ToString() != "")
                    {
                        DateTime _commitment = DateTime.Parse(drAnswer["commitment"].ToString());
                        if (_commitment < _date)
                        {
                            _date = _commitment;
                        }
                    }
                    double dblQuantity = 0.00;
                    double.TryParse(drAnswer["quantity"].ToString(), out dblQuantity);
                    int intClass = 0;
                    if (Int32.TryParse(drAnswer["classid"].ToString(), out intClass) == true && oClass.IsProd(intClass))
                    {
                        double dblRecovery = 0.00;
                        double.TryParse(drAnswer["quantity"].ToString(), out dblRecovery);
                        dblQuantity += dblRecovery;
                    }
                    dblCount1 += dblQuantity;
                }
                //dblCount2 += dblCount1;
                if (_date == DateTime.MaxValue)
                {
                    dr["implementation"] = "N / A";
                }
                else
                {
                    dr["implementation"] = _date.ToShortDateString();
                }
                dr["quantity"] = dblCount1.ToString();
                dblCount1      = 0.00;
            }



            if (_start > ds.Tables[0].Rows.Count)
            {
                _start = 0;
            }
            intRecordStart = _start + 1;
            DataView dv = ds.Tables[0].DefaultView;

            if (Request.QueryString["sort"] != null)
            {
                dv.Sort = Request.QueryString["sort"];
            }
            dv.RowFilter = LoadFilter();
            LoadLists(dv);
            int intCount = _start + intRecords;

            if (dv.Count < intCount)
            {
                intCount = dv.Count;
            }
            int ii = 0;

            lblRecords.Text = "Models " + intRecordStart.ToString() + " - " + intCount.ToString() + " of " + dv.Count.ToString();
            for (ii = 0; ii < _start && ii < intCount; ii++)
            {
                dv[0].Delete();
            }
            int intTotalCount = (dv.Count - intRecords);

            for (ii = 0; ii < intTotalCount; ii++)
            {
                dv[intRecords].Delete();
            }
            rptView.DataSource = dv;
            rptView.DataBind();
            Projects        oProject        = new Projects(intProfile, dsn);
            Requests        oRequest        = new Requests(intProfile, dsn);
            ProjectsPending oProjectPending = new ProjectsPending(intProfile, dsn, intEnvironment);
            Users           oUser           = new Users(intProfile, dsn);
            StatusLevels    oStatusLevel    = new StatusLevels();

            lblNone.Visible = (rptView.Items.Count == 0);
            _start++;
        }
Ejemplo n.º 12
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");
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
        private void LoopRepeater(string _sort, int _start)
        {
            DataSet ds        = oForecast.Gets();
            double  dblCount1 = 0;

            DataColumn dc1 = new DataColumn("implementation", System.Type.GetType("System.DateTime"));

            ds.Tables[0].Columns.Add(dc1);
            DataColumn dc2 = new DataColumn("quantity", System.Type.GetType("System.Int32"));

            ds.Tables[0].Columns.Add(dc2);
            DataColumn dc3 = new DataColumn("amp", System.Type.GetType("System.Double"));

            ds.Tables[0].Columns.Add(dc3);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int      intForecast = Int32.Parse(dr["id"].ToString());
                DataSet  dsAnswers   = oForecast.GetAnswers(intForecast);
                DateTime _date       = DateTime.MaxValue;
                foreach (DataRow drAnswer in dsAnswers.Tables[0].Rows)
                {
                    //bool boolOverride = (dr["override"].ToString() == "1");
                    if (drAnswer["implementation"].ToString() != "")
                    {
                        DateTime _commitment = DateTime.Parse(drAnswer["implementation"].ToString());
                        if (_commitment < _date)
                        {
                            _date = _commitment;
                        }
                    }
                    double dblQuantity = double.Parse(drAnswer["quantity"].ToString()) + double.Parse(drAnswer["recovery_number"].ToString());
                    dblCount1 += dblQuantity;
                }
                //dblCount2 += dblCount1;
                dr["implementation"] = _date.ToShortDateString();
                dr["quantity"]       = dblCount1.ToString();
                dblCount1            = 0.00;
            }



            if (_start > ds.Tables[0].Rows.Count)
            {
                _start = 0;
            }
            intRecordStart = _start + 1;
            DataView dv = ds.Tables[0].DefaultView;

            if (Request.QueryString["sort"] != null)
            {
                dv.Sort = Request.QueryString["sort"];
            }
            dv.RowFilter = LoadFilter();
            LoadLists(dv);
            int intCount = _start + intRecords;

            if (dv.Count < intCount)
            {
                intCount = dv.Count;
            }
            int ii = 0;

            lblRecords.Text = "Models " + intRecordStart.ToString() + " - " + intCount.ToString() + " of " + dv.Count.ToString();
            for (ii = 0; ii < _start && ii < intCount; ii++)
            {
                dv[0].Delete();
            }
            int intTotalCount = (dv.Count - intRecords);

            for (ii = 0; ii < intTotalCount; ii++)
            {
                dv[intRecords].Delete();
            }
            rptView.DataSource = dv;
            rptView.DataBind();
            Projects        oProject        = new Projects(intProfile, dsn);
            Requests        oRequest        = new Requests(intProfile, dsn);
            ProjectsPending oProjectPending = new ProjectsPending(intProfile, dsn, intEnvironment);
            Users           oUser           = new Users(intProfile, dsn);
            StatusLevels    oStatusLevel    = new StatusLevels();

            //foreach (RepeaterItem ri in rptView.Items)
            //{
            //    Label lblProject = (Label)ri.FindControl("lblProject");
            //    int intProject = Int32.Parse(lblProject.Text);
            //    Label lblRequest = (Label)ri.FindControl("lblRequest");
            //    int intRequest = Int32.Parse(lblRequest.Text);
            //    if (intProject > 0)
            //    {
            //        ds = oForecast.GetProject(intProject);
            //    }
            //    else
            //    {
            //        ds = oForecast.GetRequest(intRequest);
            //    }
            //    double dblAmp = 0.00;
            //    if (ds.Tables[0].Rows.Count > 0)
            //    {
            //        Label lblCount = (Label)ri.FindControl("lblCount");
            //        Label lblDate = (Label)ri.FindControl("lblDate");
            //        int intForecast = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString());
            //        Platforms oPlatform = new Platforms(intProfile, dsn);
            //        ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn);
            //        ds = oForecast.GetAnswers(intForecast);
            //        DateTime _date = DateTime.MaxValue;
            //        foreach (DataRow dr in ds.Tables[0].Rows)
            //        {
            //            //bool boolOverride = (dr["override"].ToString() == "1");
            //            if (dr["implementation"].ToString() != "")
            //            {
            //                DateTime _commitment = DateTime.Parse(dr["implementation"].ToString());
            //                if (_commitment < _date)
            //                    _date = _commitment;
            //            }
            //        //    // Get AMP
            //        //    int intModel = 0;
            //        //    int intServerModel = oForecast.GetModel(Int32.Parse(dr["id"].ToString()));
            //        //    if (intServerModel == 0)
            //        //    {
            //        //        // Get the model selected in the equipment dropdown (if not server)
            //        //        intModel = Int32.Parse(dr["modelid"].ToString());
            //        //        if (boolOverride == true && intModel > 0)
            //        //        {
            //        //            intServerModel = intModel;
            //        //            intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
            //        //        }
            //        //    }
            //        //    if (intServerModel > 0)
            //        //        dblAmp += (double.Parse(oModelsProperties.Get(intServerModel, "amp")) * dblQuantity);
            //        //    else if (intModel > 0)
            //        //    {
            //        //        if (oModelsProperties.Get(intModel).Tables[0].Rows.Count > 0)
            //        //        {
            //        //            double dblAmpTemp = (double.Parse(oModelsProperties.Get(intModel, "amp")) * dblQuantity);
            //        //            dblAmp += dblAmpTemp;
            //        //        }
            //        //    }
            //        //    else
            //        //    {
            //        //        DataSet dsVendor = oForecast.GetAnswer(Int32.Parse(dr["id"].ToString()));
            //        //        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);
            //        //    }
            //        }
            //        lblDate.Text = (_date == DateTime.MaxValue ? "---" : _date.ToShortDateString());
            //        lblCount.Text = dblCount2.ToString();
            //    }
            //    Label lblAmp = (Label)ri.FindControl("lblAmp");
            //    lblAmp.Text = dblAmp.ToString("F");
            //}
            lblNone.Visible = (rptView.Items.Count == 0);
            _start++;
        }
Ejemplo n.º 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage            = new Pages(intProfile, dsn);
     oRequestItem     = new RequestItems(intProfile, dsn);
     oApplication     = new Applications(intProfile, dsn);
     oVariable        = new Variables(intEnvironment);
     oRequestField    = new RequestFields(intProfile, dsn);
     oService         = new Services(intProfile, dsn);
     oCustomized      = new Customized(intProfile, dsn);
     oRequest         = new Requests(intProfile, dsn);
     oProject         = new Projects(intProfile, dsn);
     oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment);
     oServiceRequest  = new ServiceRequests(intProfile, dsn);
     oLocation        = new Locations(intProfile, dsn);
     oClass           = new Classes(intProfile, dsn);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
     {
         LoadValues();
         if (!IsPostBack)
         {
             LoadLists();
         }
         // Custom Loads
         int    intItem        = Int32.Parse(lblItem.Text);
         int    intApp         = oRequestItem.GetItemApplication(intItem);
         string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
         if (strDeliverable != "")
         {
             panDeliverable.Visible = true;
             btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
         }
     }
     strLocation = oLocation.LoadDDL("ddlState", "ddlCity", "ddlAddress", hdnLocation.ClientID, intLocation, true, "ddlCommon");
     ddlClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlClass.ClientID + "','" + ddlEnvironment.ClientID + "',0);");
     ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
     ddlCluster.Attributes.Add("onchange", "ResetDiv(null);SwapDivDDL(this,'" + divClusterYes.ClientID + "','" + divClusterYesGroup.ClientID + "','" + divClusterNo.ClientID + "',null);");
     ddlClusterYesSQL.Attributes.Add("onchange", "ResetDiv('" + divClusterYesSQLNoMount.ClientID + "');SwapDivDDL(this,'" + divClusterYesSQLYes.ClientID + "',null,'" + divClusterYesSQLNo.ClientID + "',null);");
     ddlClusterYesSQLYesVersion.Attributes.Add("onchange", "ShowDivDDL(this,'" + divSQLYes2005.ClientID + "',1);");
     ddlClusterYesSQLGroup.Attributes.Add("onchange", "SwapDivDDL(this,'" + divClusterYesGroupNew.ClientID + "',null,'" + divClusterYesGroupExisting.ClientID + "',null);");
     ddlClusterYesSQLNoType.Attributes.Add("onchange", "ShowDivDDL(this,'" + divClusterYesSQLNoMount.ClientID + "',2);");
     ddlClusterNoSQL.Attributes.Add("onchange", "SwapDivDDL(this,'" + divClusterNoSQLYes.ClientID + "',null,'" + divClusterNoSQLNo.ClientID + "',null);");
     ddlClusterNoSQLYesVersion.Attributes.Add("onchange", "ShowDivDDL(this,'" + divSQLYes2005.ClientID + "',1);");
     txtClusterNoSQLDBA.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divClusterNoSQLDBA.ClientID + "','" + lstClusterNoSQLDBA.ClientID + "','" + hdnDBA.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
     lstClusterNoSQLDBA.Attributes.Add("ondblclick", "AJAXClickRow();");
     txtClusterYesSQLDBA.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divClusterYesSQLDBA.ClientID + "','" + lstClusterYesSQLDBA.ClientID + "','" + hdnDBA.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
     lstClusterYesSQLDBA.Attributes.Add("ondblclick", "AJAXClickRow();");
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
     btnNext.Attributes.Add("onclick", "return ValidateText('" + txtServerName.ClientID + "','Please enter the server name')" +
                            " && ValidateDropDown('" + ddlOS.ClientID + "','Please select the operating system')" +
                            " && ValidateDropDown('" + ddlMaintenance.ClientID + "','Please select the maintenance window')" +
                            " && ValidateDropDown('" + ddlCurrent.ClientID + "','Please select if the server currently has SAN')" +
                            " && ValidateDropDown('" + ddlType.ClientID + "','Please select the server type')" +
                            " && ValidateDropDown('" + ddlDR.ClientID + "','Please select the DR options')" +
                            " && ValidateDropDown('" + ddlPerformance.ClientID + "','Please select the performance type')" +
                            " && ValidateDropDown('" + ddlChange.ClientID + "','Please select if you have scheduled a change')" +
                            " && ValidateDropDown('" + ddlCluster.ClientID + "','Please select if the server is part of a cluster')" +
                            " && EnsureStorage3rd('" + ddlCluster.ClientID + "','" + ddlClusterNoSQL.ClientID + "','" + ddlClusterNoSQLNo.ClientID + "','" + ddlClusterNoSQLYesVersion.ClientID + "','" + hdnDBA.ClientID + "','" + txtClusterNoSQLDBA.ClientID + "','" + ddlClusterYesSQL.ClientID + "','" + ddlClusterYesSQLYesVersion.ClientID + "','" + ddlClusterYesSQLGroup.ClientID + "','" + txtClusterYesGroupExisting.ClientID + "','" + chkClusterYesGroupNewNetwork.ClientID + "','" + txtClusterYesGroupNewNetwork.ClientID + "','" + chkClusterYesGroupNewIP.ClientID + "','" + txtClusterYesGroupNewIP.ClientID + "','" + txtClusterYesSQLDBA.ClientID + "','" + ddlClusterYesSQLNoType.ClientID + "','" + txtClusterYesSQLNoMount.ClientID + "')" +
                            " && ValidateText('" + txtDescription.ClientID + "','Please enter a description of the work to be performed')" +
                            " && ValidateDropDown('" + ddlClass.ClientID + "','Please select the class')" +
                            " && ValidateDropDown('" + ddlEnvironment.ClientID + "','Please select the environment')" +
                            " && ValidateDropDown('" + ddlFabric.ClientID + "','Please select the fabric')" +
                            " && ValidateDropDown('" + ddlReplicated.ClientID + "','Please select if this device is being replicated')" +
                            " && ValidateDropDown('" + ddlHA.ClientID + "','Please select if this device requires high availability storage')" +
                            " && ValidateDropDown('" + ddlType2.ClientID + "','Please select a type of storage')" +
                            " && ValidateDropDown('" + ddlExpand.ClientID + "','Please select if you want to expand a LUN or add an additional LUN')" +
                            " && ValidateNumber0('" + txtAdditional.ClientID + "','Please enter the total amount of storage')" +
                            ";");
     imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
     btnLunAdd.Attributes.Add("onclick", "return ValidateText('" + txtLUNs.ClientID + "','Please enter some text') && ValidateNoComma('" + txtLUNs.ClientID + "','The text cannot contain a comma (,)\\n\\nPlease click OK and remove all commas') && ListControlIn('" + lstLUNs.ClientID + "','" + hdnLUNs.ClientID + "','" + txtLUNs.ClientID + "');");
     btnLunDelete.Attributes.Add("onclick", "return ListControlOut('" + lstLUNs.ClientID + "','" + hdnLUNs.ClientID + "');");
     txtLUNs.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnLunAdd.ClientID + "').click();return false;}} else {return true}; ");
 }
        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();
            }
        }