Exemplo n.º 1
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);
     oGroupRequest = new GroupRequest(intProfile, dsn);
     oRequest      = new Requests(intProfile, dsn);
     oFunction     = new Functions(intProfile, dsn, intEnvironment);
     oDomain       = new Domains(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)
     {
         if (!IsPostBack)
         {
             LoadLists();
         }
         LoadValues();
         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 + "');");
         }
         if (Request.QueryString["g"] != null && Request.QueryString["g"] != "" && Request.QueryString["d"] != null && Request.QueryString["d"] != "")
         {
             if (!IsPostBack)
             {
                 LoadObjects();
             }
             btnNext.Attributes.Add("onclick", "return ValidateText('" + txtTo.ClientID + "','Please enter a group name')" +
                                    " && EnsureGroupScope('" + radDLG.ClientID + "','" + radGG.ClientID + "','" + radUG.ClientID + "')" +
                                    " && EnsureGroupType('" + radS.ClientID + "','" + radD.ClientID + "')" +
                                    ";");
         }
         else
         {
             btnNext.Enabled = false;
         }
         btnContinue.Attributes.Add("onclick", "return ValidateText('" + txtFrom.ClientID + "','Please enter a group name')" +
                                    " && ValidateDropDown('" + ddlDomain.ClientID + "','Please select a domain')" +
                                    ";");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
 }
Exemplo 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);
            oServiceEditor  = new ServiceEditor(intProfile, dsnServiceEditor);
            oCustomized     = new Customized(intProfile, dsn);
            oRequest        = new Requests(intProfile, dsn);
            oProject        = new Projects(intProfile, dsn);
            oService        = new Services(intProfile, dsn);
            oFunction       = new Functions(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["returned"] != null)
            {
                boolReqReturned = true;
            }
            if (Request.QueryString["denied"] != null)
            {
                boolReqDenied = true;
            }

            if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
            {
                LoadValues();
                if (!IsPostBack)
                {
                    LoadRequest();
                }
                radExpediteYes.Attributes.Add("onclick", "Expedite(this, '" + radExpediteNo.ClientID + "');");
                // Custom Loads
                int    intItem        = Int32.Parse(lblItem.Text);
                int    intApp         = oRequestItem.GetItemApplication(intItem);
                string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                if (strDeliverable != "")
                {
                    btnDeliverable.Visible = true;
                    btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
                }
                btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + Request.QueryString["rid"] + "');");
            }
            btnBack.Attributes.Add("onclick", "return confirm('WARNING: Any unsaved changes will be lost.\\n\\nAre you sure you want to continue?') && ProcessButton(this) && LoadWait();");
            btnCancel.Attributes.Add("onclick", "return confirm('WARNING: Any unsaved changes will be lost.\\n\\nAre you sure you want to continue?') && ProcessButton(this) && LoadWait();");
            btnCancelR.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?') && ProcessButton(this) && LoadWait();");
        }
Exemplo 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);
     oRequest      = new Requests(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);
     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"] != null && Request.QueryString["rid"] != "")
     {
         if (!IsPostBack)
         {
             LoadLists();
         }
         if (Request.QueryString["q"] != null && Request.QueryString["q"] != "")
         {
             txtServer.Text = Request.QueryString["q"];
         }
         LoadValues();
         btnNext.Attributes.Add("onclick", "return ValidateText('" + txtServer.ClientID + "','Please enter a server name')" +
                                " && ValidateRadioButtons('" + radPhysical.ClientID + "','" + radVirtual.ClientID + "','Please select the destination server type for this retrieval')" +
                                " && (document.getElementById('" + radPhysical.ClientID + "').checked == false || (document.getElementById('" + radPhysical.ClientID + "').checked == true && ValidateDropDown('" + ddlModel.ClientID + "','Please select the preferred server model')))" +
                                " && ValidateText('" + txtCode.ClientID + "','Please enter an application code')" +
                                " && ValidateDropDown('" + ddlClass.ClientID + "','Please select a class')" +
                                " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid date of completion')" +
                                " && ValidateCheck('" + chkAgreement.ClientID + "','Please check that you have read and agreed to the disclaimer')" +
                                ";");
         radPhysical.Attributes.Add("onclick", "ShowHideDiv('" + divPhysical.ClientID + "','inline');");
         radVirtual.Attributes.Add("onclick", "ShowHideDiv('" + divPhysical.ClientID + "','none');");
         imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
         btnSearch.Attributes.Add("onclick", "return ShowTextInfo('" + txtServer.ClientID + "','ARCHIVED_SEARCH');");
         txtServer.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnSearch.ClientID + "').click();return false;}} else {return true}; ");
         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 delete this service request?');");
 }
Exemplo 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);
     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 + "');");
 }
Exemplo 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);
     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?');");
 }
Exemplo 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();
         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?');");
 }
Exemplo 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();
         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?');");
 }
Exemplo 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);
     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?');");
 }
 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);
     oRequest     = new Requests(intProfile, dsn);
     oWorkstation = new Workstations(intProfile, dsn);
     oApplication = new Applications(intProfile, dsn);
     oForecast    = new Forecast(intProfile, dsn);
     oFunction    = new Functions(intProfile, dsn, intEnvironment);
     oUser        = new Users(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();
         int    intItem        = Int32.Parse(lblItem.Text);
         int    intService     = Int32.Parse(lblService.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 + "');");
         }
         if (Request.QueryString["n"] != null && Request.QueryString["n"] != "")
         {
             if (!IsPostBack)
             {
                 LoadWorkstation();
             }
         }
         else if (Request.QueryString["formid"] == null || Request.QueryString["formid"] == "")
         {
             btnNext.Enabled = false;
         }
         btnContinue.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Please enter a workstation name') && ProcessButton(this) && LoadWait();");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
     imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
 }
Exemplo n.º 10
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);
     oAccountRequest = new AccountRequest(intProfile, dsn);
     oRequest        = new Requests(intProfile, dsn);
     oDomain         = new Domains(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)
     {
         if (Request.QueryString["invalid"] != null && Request.QueryString["invalid"] != "")
         {
             Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('The user account could not be found.\\n\\nPlease enter a valid account to continue.');<" + "/" + "script>");
         }
         if (!IsPostBack)
         {
             LoadLists();
         }
         LoadValues();
         btnNext.Attributes.Add("onclick", "return ValidateText('" + txtUser.ClientID + "','Please enter a user ID')" +
                                " && ValidateDropDown('" + ddlDomain.ClientID + "','Please select a domain')" +
                                " && ValidateText('" + txtPassword1.ClientID + "','Please enter a password')" +
                                " && ValidateText('" + txtPassword2.ClientID + "','Please confirm the password')" +
                                " && EnsurePassword('" + txtPassword1.ClientID + "','" + txtPassword2.ClientID + "')" +
                                " && ValidatePassword('" + txtPassword1.ClientID + "','Your password does not meet the following conditions\\n\\n- Must be at least 6 characters long\\n- Must contain at least one number')" +
                                ";");
         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 delete this service request?');");
 }
Exemplo n.º 11
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?');");
 }
Exemplo n.º 12
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);
     oRequest      = new Requests(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);
     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)
     {
         if (!IsPostBack)
         {
             LoadLists();
         }
         LoadValues();
         btnNext.Attributes.Add("onclick", "return ValidateText('" + txtServer.ClientID + "','Please enter a server name')" +
                                " && ValidateDropDown('" + ddlModel.ClientID + "','Please select a model')" +
                                " && ValidateText('" + txtCode.ClientID + "','Please enter an application code')" +
                                " && ValidateDropDown('" + ddlClass.ClientID + "','Please select a class')" +
                                " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid date of completion')" +
                                " && ValidateCheck('" + chkAgreement.ClientID + "','Please check that you have read and agreed to the disclaimer')" +
                                ";");
         imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
         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 delete this service request?');");
 }
Exemplo n.º 13
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);
     oGroupRequest = new GroupRequest(intProfile, dsn);
     oRequest      = new Requests(intProfile, dsn);
     oFunction     = new Functions(intProfile, dsn, intEnvironment);
     oDomain       = new Domains(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)
     {
         if (Request.QueryString["invalid"] != null && Request.QueryString["invalid"] != "")
         {
             Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('A group with this name already exists.\\n\\nPlease enter a valid group name to continue.');<" + "/" + "script>");
         }
         if (!IsPostBack)
         {
             LoadLists();
         }
         LoadValues();
         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 + "');");
         }
         btnNext.Attributes.Add("onclick", "return ValidateText('" + txtGroup.ClientID + "','Please enter a group name')" +
                                " && ValidateDropDown('" + ddlDomain.ClientID + "','Please select a domain')" +
                                " && EnsureGroupScope('" + radDLG.ClientID + "','" + radGG.ClientID + "','" + radUG.ClientID + "')" +
                                " && EnsureGroupType('" + radS.ClientID + "','" + radD.ClientID + "')" +
                                ";");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
 }
Exemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = "/admin/services_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");
     }
     oService       = new Services(intProfile, dsn);
     oServiceEditor = new ServiceEditor(intProfile, dsn);
     oRequestItem   = new RequestItems(intProfile, dsn);
     oApplication   = new Applications(intProfile, dsn);
     oUser          = new Users(intProfile, dsn);
     if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         intService      = Int32.Parse(Request.QueryString["id"]);
         panView.Visible = true;
         if (!IsPostBack)
         {
             LoadServices(0);
             lblName.Text = oService.GetName(intService);
             int intItem = oService.GetItemId(intService);
             lblItem.Text        = oRequestItem.GetItemName(intItem);
             lblApplication.Text = oApplication.GetName(oRequestItem.GetItemApplication(intItem));
             DataSet ds = oService.GetUser(intService, -1);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 lblUser.Text = oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString()));
             }
         }
     }
     else
     {
         panAll.Visible     = true;
         rptView.DataSource = oService.GetPending();
         rptView.DataBind();
     }
     btnSave.Attributes.Add("onclick", "return confirm('Are you sure you want to save this service?');");
     btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service?');");
 }
 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);
     oRequest     = new Requests(intProfile, dsn);
     oApplication = new Applications(intProfile, dsn);
     oWorkstation = new Workstations(intProfile, dsn);
     oCustomized  = 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)
     {
         if (!IsPostBack)
         {
             LoadLists();
         }
         LoadValues();
         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 + "');");
         }
         Variables oVariable = new Variables(intEnvironment);
         txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divManager.ClientID + "','" + lstManager.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstManager.Attributes.Add("ondblclick", "AJAXClickRow();");
         btnManager.Attributes.Add("onclick", "return OpenWindow('NEW_USER','');");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to cancel this service request?');");
 }
Exemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProject         = new Projects(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oUser            = new Users(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oRequestField    = new RequestFields(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oOnDemandTasks   = new OnDemandTasks(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oClass           = new Classes(intProfile, dsn);
            oServer          = new Servers(0, 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["rrid"] != null && Request.QueryString["rrid"] != "")
            {
                lblResourceWorkflow.Text = Request.QueryString["rrid"];
                int     intResourceWorkflow = Int32.Parse(Request.QueryString["rrid"]);
                int     intResourceParent   = oResourceRequest.GetWorkflowParent(intResourceWorkflow);
                DataSet ds = oResourceRequest.Get(intResourceParent);
                intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                // Workflow start
                bool boolComplete = (oResourceRequest.GetWorkflow(intResourceWorkflow, "status") == "3");
                int  intUser      = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid"));
                txtCustom.Text = oResourceRequest.GetWorkflow(intResourceWorkflow, "name");
                double dblAllocated = double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated"));
                // Workflow end
                int intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                lblService.Text = oService.Get(intService, "name");
                int intApp = oRequestItem.GetItemApplication(intItem);

                double dblUsed = oResourceRequest.GetWorkflowUsed(intResourceWorkflow);
                lblUpdated.Text = oResourceRequest.GetUpdated(intResourceParent);
                dblUsed         = (dblUsed / dblAllocated) * 100;
                if (Request.QueryString["save"] != null && Request.QueryString["save"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Information Saved Successfully');<" + "/" + "script>");
                }
                if (Request.QueryString["status"] != null && Request.QueryString["status"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Weekly Status has been Added');<" + "/" + "script>");
                }
                intProject          = oRequest.GetProjectNumber(intRequest);
                hdnTab.Value        = "D";
                panWorkload.Visible = true;
                LoadStatus(intResourceWorkflow);
                bool boolDone = LoadInformation(intResourceWorkflow);
                if (boolDone == true)
                {
                    if (boolComplete == false)
                    {
                        oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                        btnComplete.Attributes.Add("onclick", "return ValidateDropDown('" + ddlSuccess.ClientID + "','Please select a status') && confirm('Are you sure you want to mark this as completed and remove it from your workload?');");
                    }
                    else
                    {
                        oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                        btnComplete.Attributes.Add("onclick", "alert('This task has already been marked COMPLETE. You can close this window.');return false;");
                    }
                    imgSuccess.ImageUrl = "/images/green_arrow.gif";
                    btnSave.ImageUrl    = "/images/tool_save.gif";
                    btnSave.Enabled     = false;
                }
                else
                {
                    btnComplete.ImageUrl = "/images/tool_complete_dbl.gif";
                    btnComplete.Enabled  = false;
                    oFunction.ConfigureToolButton(btnSave, "/images/tool_save");
                }

                btnDenied.Attributes.Add("onclick", "return CloseWindow();");
                oFunction.ConfigureToolButton(btnSave, "/images/tool_save");
                oFunction.ConfigureToolButton(btnPrint, "/images/tool_print");
                btnPrint.Attributes.Add("onclick", "return PrintWindow();");
                oFunction.ConfigureToolButton(btnClose, "/images/tool_close");
                btnClose.Attributes.Add("onclick", "return ExitWindow();");
                btnSave.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtIssues.ClientID + "');");
                // 6/1/2009 - Load ReadOnly View
                if (oResourceRequest.CanUpdate(intProfile, intResourceWorkflow, false) == false)
                {
                    oFunction.ConfigureToolButtonRO(btnSave, btnComplete);
                    //panDenied.Visible = true;
                }
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Exemplo n.º 17
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);
            oRequest        = new Requests(intProfile, dsn);
            oRequestField   = new RequestFields(intProfile, dsn);
            oApplication    = new Applications(intProfile, dsn);
            oAccountRequest = new AccountRequest(intProfile, dsn);
            oUser           = new Users(intProfile, dsn);
            oDomain         = new Domains(intProfile, dsn);
            oFunction       = new Functions(intProfile, dsn, intEnvironment);

            //Menus
            int intMenuTab = 0;

            if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
            {
                intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
            }
            Tab oTab = new Tab("", intMenuTab, "divMenu1", true, false);

            //Tab oTab = new Tab(hdnType.ClientID, intMenuTab, "divMenu1", true, false);

            oTab.AddTab("Account Properties", "");
            oTab.AddTab("Group Memberships", "");
            strMenuTab1 = oTab.GetTabs();

            //End Menus

            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();
                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 + "');");
                }
                if (!IsPostBack)
                {
                    ddlDomain.DataValueField = "id";
                    ddlDomain.DataTextField  = "name";
                    ddlDomain.DataSource     = oDomain.GetsAccountMaintenance(0, 1);
                    ddlDomain.DataBind();
                    ddlDomain.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                }
                if (Request.QueryString["u"] != null && Request.QueryString["u"] != "" && Request.QueryString["d"] != null && Request.QueryString["d"] != "")
                {
                    if (!IsPostBack)
                    {
                        LoadObjects();
                    }
                    btnNext.Attributes.Add("onclick", "return ValidateText('" + txtFirst.ClientID + "','Please enter a first name')" +
                                           " && ValidateText('" + txtLast.ClientID + "','Please enter a last name')" +
                                           " && ValidateText('" + txtPassword1.ClientID + "','Please enter the password')" +
                                           " && ValidateText('" + txtPassword2.ClientID + "','Please enter the password')" +
                                           " && ValidatePasswords('" + txtPassword1.ClientID + "','" + txtPassword2.ClientID + "','Passwords do not match.\\n\\nPlease retype the passwords')" +
                                           " && ValidatePassword('" + txtPassword1.ClientID + "','Your password does not meet the following conditions\\n\\n- Must be at least 6 characters long\\n- Must contain at least one number')" +
                                           ";");
                }
                else
                {
                    btnNext.Enabled = false;
                }
                btnContinue.Attributes.Add("onclick", "return ValidateText('" + txtID.ClientID + "','Please enter a user ID')" +
                                           " && ValidateDropDown('" + ddlDomain.ClientID + "','Please select a domain')" +
                                           ";");
            }
            btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
        }
Exemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProjectRequest  = new ProjectRequest(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oProjectNumber   = new ProjectNumber(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oService         = new Services(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oServiceDetail   = new ServiceDetails(intProfile, dsn);
            oLog             = new Log(intProfile, dsn);
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.QueryString["action"] != null && Request.QueryString["action"] != "")
            {
                panFinish.Visible = true;
            }
            else
            {
                if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
                {
                    intApplication = Int32.Parse(Request.QueryString["applicationid"]);
                }
                if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
                {
                    intApplication = Int32.Parse(Request.Cookies["application"].Value);
                }
                if (!IsPostBack)
                {
                    if (Request.QueryString["rrid"] != null && Request.QueryString["rrid"] != "")
                    {
                        lblResourceParent.Text = Request.QueryString["rrid"];
                        int intResourceParent = Int32.Parse(lblResourceParent.Text);
                        ds = oResourceRequest.Get(intResourceParent);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            int      intItem     = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                            int      intService  = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                            int      intRequest  = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                            int      intNumber   = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                            int      intProject  = Int32.Parse(oRequest.Get(intRequest, "projectid"));
                            int      intApp      = oRequestItem.GetItemApplication(intItem);
                            int      intForecast = 0;
                            Forecast oForecast   = new Forecast(intProfile, dsn);
                            DataSet  dsForecast  = oForecast.GetProject(intProject);
                            if (dsForecast.Tables[0].Rows.Count > 0)
                            {
                                intForecast = Int32.Parse(dsForecast.Tables[0].Rows[0]["id"].ToString());
                            }
                            if (intForecast > 0)
                            {
                                btnView.Attributes.Add("oncontextmenu", "return OpenWindow('NEW_WINDOW','" + oPage.GetFullLink(intDesignBuilder) + "?id=" + intForecast.ToString() + "');");
                            }
                            else
                            {
                                btnView.Attributes.Add("oncontextmenu", "alert('There is no design for this project');return false;");
                            }
                            if (ds.Tables[0].Rows[0]["solo"].ToString() == "0")
                            {
                                btnView.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewRequest.ToString() + "&rid=" + intRequest.ToString() + "');");
                                btnView.Text = "Click here to view the project details";
                                lblType.Text = "Project Request";
                            }
                            else
                            {
                                btnView.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewResourceRequest.ToString() + "&rrid=" + intResourceParent.ToString() + "');");
                                if (oApplication.Get(intApp, "tpm") == "1")
                                {
                                    btnView.Text = "Click here to view the project details";
                                }
                                else
                                {
                                    btnView.Text = "Click here to view this request";
                                }
                                lblType.Text = "Service Request";
                            }
                            btnAssignments.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intSearchPage.ToString() + "&pid=" + intProject + "&aid=" + intApp.ToString() + "&sort=userid');");
                            lblItem.Text      = intItem.ToString();
                            lblService.Text   = oService.GetName(intService);
                            lblServiceID.Text = intService.ToString();
                            if (oApplication.Get(intApp, "request_items") == "1")
                            {
                                lblGroup.Text = oApplication.GetName(intApp) + " | " + oRequestItem.GetItemName(intItem);
                            }
                            else
                            {
                                lblGroup.Text = oApplication.GetName(intApp);
                            }
                            int intUser       = Int32.Parse(oRequest.Get(intRequest, "userid"));
                            int intAppManager = oApplication.GetManager(intApp);
                            if (ds.Tables[0].Rows[0]["accepted"].ToString() == "-1" && oApplication.Get(intApp, "tpm") == "1")
                            {
                                if (intUser == intProfile || oDelegate.Get(intUser, intProfile) > 0)
                                {
                                    panRequest.Visible         = true;
                                    panAssignSingle.Visible    = true;
                                    txtHours.Text              = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    lblHoursOverall.Text       = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    txtQuantityOverall.Text    = ds.Tables[0].Rows[0]["devices"].ToString();
                                    txtQuantityOverall.Enabled = false;
                                    txtQuantity.Text           = txtQuantityOverall.Text;
                                    txtQuantity.Enabled        = false;
                                    lblHours.Visible           = true;
                                    lblHours.Text              = txtHours.Text;
                                    lblStatus.Text             = oStatusLevel.HTML(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                                    txtQuantity.Text           = ds.Tables[0].Rows[0]["devices"].ToString();
                                    btnAssign.Enabled          = (txtQuantity.Text != "0");
                                    lblAssignBy.Text           = oUser.GetFullName(intProfile);
                                    strSummary = oResourceRequest.GetBodyOverallFix(intResourceParent, 0, intEnvironment, false);
                                }
                                else
                                {
                                    Response.Write("no rights");
                                    panDenied.Visible = true;
                                }
                                btnSubmit.Attributes.Add("onclick", "return ValidateNumber0('" + txtHours.ClientID + "','Please enter a valid number for the hours allocated') && ValidateHidden('" + hdnManager.ClientID + "','" + txtManager.ClientID + "','Please enter a valid LAN ID') && ProcessButton(this);");
                            }
                            else
                            {
                                if (oUser.IsAdmin(intProfile) || oService.IsManager(intService, intProfile) || (oApplication.IsManager(intApp, intProfile) && oApplication.Get(intApp, "disable_manager") != "1"))
                                {
                                    panRequest.Visible        = true;
                                    panAssignMultiple.Visible = true;
                                    btnSubmit.Enabled         = (ds.Tables[0].Rows[0]["assigned"].ToString() == "");
                                    if (ds.Tables[0].Rows[0]["status"].ToString() == "5")
                                    {
                                        radHold.Checked            = true;
                                        divChoice.Style["display"] = "inline";
                                        divHold.Style["display"]   = "inline";
                                        txtHold.Text = ds.Tables[0].Rows[0]["reason"].ToString();
                                    }
                                    else
                                    {
                                        divChoice.Style["display"] = (ds.Tables[0].Rows[0]["accepted"].ToString() == "0" ? "inline" : "none");
                                        if (Request.QueryString["assign"] != null)
                                        {
                                            divAccept.Style["display"] = "inline";
                                            radAccept.Checked          = true;
                                        }
                                        else
                                        {
                                            divAccept.Style["display"] = (ds.Tables[0].Rows[0]["accepted"].ToString() == "1" ? "inline" : "none");
                                        }
                                    }
                                    panDelete.Visible = (intItem == intImplementorDistributed || intItem == intImplementorMidrange);
                                    btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this request');");
                                    txtHours.Text           = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    lblHoursOverall.Text    = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    txtQuantityOverall.Text = ds.Tables[0].Rows[0]["devices"].ToString();
                                    if (oApplication.Get(intApp, "tpm") == "1")
                                    {
                                        lblHours.Visible           = true;
                                        lblHours.Text              = txtHours.Text;
                                        txtQuantityOverall.Enabled = false;
                                        txtQuantity.Enabled        = false;
                                        btnAssign.Attributes.Add("onclick", "return ValidateDropDown('" + ddlUser.ClientID + "','Please select a technician')" +
                                                                 " && ProcessButton(this)" +
                                                                 ";");
                                    }
                                    else if (oServiceDetail.Gets(intService, 1).Tables[0].Rows.Count > 0)
                                    {
                                        lblHours.Visible = true;
                                        lblHours.Text    = "TBD ";
                                        btnWhy.Visible   = true;
                                        btnAssign.Attributes.Add("onclick", "return ValidateDropDown('" + ddlUser.ClientID + "','Please select a technician')" +
                                                                 " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter the quantity')" +
                                                                 " && ProcessButton(this)" +
                                                                 ";");
                                    }
                                    else if (oService.Get(intService, "disable_hours") == "1")
                                    {
                                        lblHours.Visible = true;
                                        lblHours.Text    = txtHours.Text;
                                        btnAssign.Attributes.Add("onclick", "return ValidateDropDown('" + ddlUser.ClientID + "','Please select a technician')" +
                                                                 " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter the quantity')" +
                                                                 " && ProcessButton(this)" +
                                                                 ";");
                                    }
                                    else
                                    {
                                        txtHours.Visible = true;
                                        btnAssign.Attributes.Add("onclick", "return ValidateDropDown('" + ddlUser.ClientID + "','Please select a technician')" +
                                                                 " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter the quantity')" +
                                                                 " && ValidateNumber0('" + txtHours.ClientID + "','Please enter the hours')" +
                                                                 " && ProcessButton(this)" +
                                                                 ";");
                                    }
                                    btnUpdate.Attributes.Add("onclick", "return ValidateNumber0('" + txtQuantityOverall.ClientID + "') && ProcessButton(this);");
                                    DataSet dsAssigned  = oResourceRequest.GetWorkflowsAssign(intResourceParent);
                                    int     intQuantity = Int32.Parse(ds.Tables[0].Rows[0]["devices"].ToString());
                                    foreach (DataRow drAssigned in dsAssigned.Tables[0].Rows)
                                    {
                                        intQuantity = intQuantity - Int32.Parse(drAssigned["devices"].ToString());
                                    }
                                    txtQuantity.Text    = intQuantity.ToString();
                                    btnAssign.Enabled   = (txtQuantity.Text != "0");
                                    lblStatus.Text      = oStatusLevel.HTML(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                                    lblAssigned.Visible = !(btnSubmit.Enabled);
                                    string  strAssign = "";
                                    DataSet dsManager = oService.GetUser(intService, 1);
                                    foreach (DataRow drManager in dsManager.Tables[0].Rows)
                                    {
                                        if (strAssign != "")
                                        {
                                            strAssign += ", ";
                                        }
                                        strAssign += oUser.GetFullName(Int32.Parse(drManager["userid"].ToString()));
                                    }
                                    lblAssignBy.Text = strAssign;
                                    DataSet   dsReports = oUser.GetManagerReports(intAppManager, intRequest, intService, intNumber);
                                    DataTable dtReports = dsReports.Tables[0].Copy();
                                    dtReports.Clear();
                                    DataSet dsAssignment = oService.GetUser(intService, -100);
                                    foreach (DataRow drAssignment in dsAssignment.Tables[0].Rows)
                                    {
                                        int     intAssignment = Int32.Parse(drAssignment["userid"].ToString());
                                        DataSet dsAssignees   = oUser.GetManagerReports(intAssignment, intRequest, intService, intNumber);
                                        foreach (DataRow drAssignee in dsAssignees.Tables[0].Rows)
                                        {
                                            dtReports.ImportRow(drAssignee);
                                        }
                                    }
                                    if (dtReports.Rows.Count > 0)
                                    {
                                        // Use custom assignment list
                                        // First, remove duplicates
                                        Hashtable hTable        = new Hashtable();
                                        ArrayList duplicateList = new ArrayList();
                                        foreach (DataRow drow in dtReports.Rows)
                                        {
                                            if (hTable.Contains(drow["userid"]))
                                            {
                                                duplicateList.Add(drow);
                                            }
                                            else
                                            {
                                                hTable.Add(drow["userid"], string.Empty);
                                            }
                                        }
                                        foreach (DataRow dRow in duplicateList)
                                        {
                                            dtReports.Rows.Remove(dRow);
                                        }

                                        // Next, sort by username
                                        dtReports.DefaultView.Sort = "username";

                                        // Now add to dataset
                                        dsReports = new DataSet();
                                        dsReports.Tables.Add(dtReports.DefaultView.ToTable());
                                    }
                                    LoadList(dsReports, intApp);
                                    LoadAvailable(dsReports, intApp);
                                    rptAssign.DataSource = dsAssigned;
                                    rptAssign.DataBind();
                                    foreach (RepeaterItem ri in rptAssign.Items)
                                    {
                                        ((LinkButton)ri.FindControl("btnDeleteAssign")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this assignment?');");
                                    }
                                    lblAssign.Visible = (rptAssign.Items.Count == 0);
                                    strSummary        = oResourceRequest.GetBodyOverallFix(intResourceParent, 0, intEnvironment, false);
                                    btnSubmit.Attributes.Add("onclick", "return ValidateChoice('" + divChoice.ClientID + "','" + radAccept.ClientID + "','" + radReject.ClientID + "','" + radHold.ClientID + "'," + dsAssigned.Tables[0].Rows.Count.ToString() + ") && ProcessButton(this);");
                                }
                                else
                                {
                                    Response.Write("no delegate");
                                    panDenied.Visible = true;
                                }
                            }
                        }
                        else
                        {
                            panDenied.Visible = true;
                        }
                    }
                    else
                    {
                        panDenied.Visible = true;
                    }
                }
            }
            btnClose.Attributes.Add("onclick", "return CloseWindow();");
            lnkAvailable.Attributes.Add("onclick", "return ShowHideAvailable('" + divAvailable.ClientID + "');");
            radAccept.Attributes.Add("onclick", "ShowHideDiv('" + divAccept.ClientID + "','inline');ShowHideDiv('" + divReject.ClientID + "','none');ShowHideDiv('" + divHold.ClientID + "','none');");
            radReject.Attributes.Add("onclick", "ShowHideDiv('" + divReject.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','none');ShowHideDiv('" + divHold.ClientID + "','none');");
            radHold.Attributes.Add("onclick", "ShowHideDiv('" + divHold.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','none');ShowHideDiv('" + divReject.ClientID + "','none');");
            txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divManager.ClientID + "','" + lstManager.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstManager.Attributes.Add("ondblclick", "AJAXClickRow();");
            btnWhy.Attributes.Add("onclick", "return ShowHideAvailable('" + divWhy.ClientID + "');");
        }
Exemplo n.º 19
0
        private void LoadRequest()
        {
            int intRequest  = Int32.Parse(Request.QueryString["rid"]);
            int intProject  = oRequest.GetProjectNumber(intRequest);
            int intPriority = 3;
            int intService  = Int32.Parse(lblService.Text);
            int intItem     = oService.GetItemId(intService);

            string strStatement = "";
            string strExpedite  = "";

            if (oService.Get(intService, "statement") == "1")
            {
                panStatement.Visible = true;
                strStatement        += " && ValidateText('" + txtStatement.ClientID + "','Please enter a statement of work')";
            }
            else
            {
                panStatement.Visible = false;
            }
            panUpload.Visible = (oService.Get(intService, "upload") == "1");
            //if (oService.Get(intService, "expedite") == "1")
            //{
            //    panExpedite.Visible = true;
            //    strExpedite += " && ValidateRadioButtons('" + radExpediteYes.ClientID + "','" + radExpediteNo.ClientID + "','Please select whether or not you want to expedite this request')";
            //}
            //else
            panExpedite.Visible = false;
            if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "")
            {
                panUpdate.Visible  = true;
                btnCancelR.Visible = boolReqReturned;
                btnCancel.Visible  = (boolReqReturned == false);
                DataSet ds = oServiceEditor.GetRequestData(intRequest, intService, Int32.Parse(lblNumber.Text), 0, dsn);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    txtTitle.Text          = ds.Tables[0].Rows[0]["title"].ToString();
                    txtStatement.Text      = ds.Tables[0].Rows[0]["statement"].ToString();
                    intPriority            = Int32.Parse(ds.Tables[0].Rows[0]["priority"].ToString());
                    radExpediteYes.Checked = (ds.Tables[0].Rows[0]["expedite"].ToString() == "1");
                    radExpediteNo.Checked  = (ds.Tables[0].Rows[0]["expedite"].ToString() == "0");
                }
                strForm = oServiceEditor.LoadForm(intService, false, false, "", intEnvironment, ds, dsn);
            }
            else
            {
                panNavigation.Visible = true;
                strForm = oServiceEditor.LoadForm(intService, false, false, "", intEnvironment, null, dsn);
            }
            // Priority and SLA
            int intApp         = oRequestItem.GetItemApplication(intItem);
            int intWorkingDays = oApplication.GetLead(intApp, intPriority);

            if (intWorkingDays > 0)
            {
                panDeliverable.Visible = true;
                //oApplication.AssignPriority(intApp, radPriority, lblDeliverable.ClientID, txtEnd.ClientID, hdnEnd.ClientID);
                lblDeliverable.Text = intWorkingDays.ToString();
                //if (boolFound == false)
                //    txtEnd.Text = DateTime.Today.AddDays(intWorkingDays).ToShortDateString();
                hdnEnd.Value = DateTime.Today.AddDays(intWorkingDays).ToShortDateString();
            }
            radPriority.SelectedValue = intPriority.ToString();
            string strRequired = oServiceEditor.GetRequired();

            // Load Title if no project
            if (intProject == -1)
            {
                panTitle.Visible = true;
                if (oService.Get(intService, "title_override") == "1")
                {
                    lblTitleName.Text = oService.Get(intService, "title_name");
                }
                btnNext.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                       strStatement +
                                       strRequired +
                                       strExpedite +
                                       " && ProcessButton(this) && LoadWait();");
                btnUpdate.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                         strStatement +
                                         strRequired +
                                         strExpedite +
                                         " && ProcessButton(this) && LoadWait();");
            }
            else
            {
                btnNext.Attributes.Add("onclick", "return true" +
                                       strStatement +
                                       strRequired +
                                       strExpedite +
                                       " && ProcessButton(this) && LoadWait();");
                btnUpdate.Attributes.Add("onclick", "return true" +
                                         strStatement +
                                         strRequired +
                                         strExpedite +
                                         " && ProcessButton(this) && LoadWait();");
            }
            //Check for returned requests
            if (boolReqReturned == true || boolReqDenied == true)
            {
                int intReturned = 0;
                Int32.TryParse(lblReturned.Text, out intReturned);
                ResourceRequest oResourceRequest = new ResourceRequest(0, dsn);
                DataSet         dsResource       = oResourceRequest.GetAllService(intRequest, intReturned, Int32.Parse(lblNumber.Text));
                if (dsResource.Tables[0].Rows.Count > 0)
                {
                    int     intResource = Int32.Parse(dsResource.Tables[0].Rows[0]["rrid"].ToString());
                    DataSet dsRR        = oResourceRequest.Get(intResource);
                    Users   oUser       = new Users(0, dsn);
                    if (dsRR.Tables[0].Rows.Count > 0)
                    {
                        if (dsRR.Tables[0].Rows[0]["status"].ToString() == "-1")
                        {
                            // Request Denied
                            lblReqDenyCommentValue.Text = dsRR.Tables[0].Rows[0]["reason"].ToString();
                            if (lblReqDenyCommentValue.Text == "")
                            {
                                int intApproved = 0;
                                // Try getting from service approval.
                                DataSet dsSelected2 = oService.GetSelected(intRequest, intReturned, Int32.Parse(lblNumber.Text));
                                for (int ii = Int32.Parse(lblNumber.Text); ii > 0 && dsSelected2.Tables[0].Rows.Count == 0; ii--)
                                {
                                    dsSelected2 = oService.GetSelected(intRequest, intReturned, ii - 1);
                                }
                                if (dsSelected2.Tables[0].Rows.Count > 0)
                                {
                                    intApproved = Int32.Parse(dsSelected2.Tables[0].Rows[0]["approved"].ToString());
                                }
                                if (intApproved < 0)
                                {
                                    lblReqDenyCommentValue.Text = dsSelected2.Tables[0].Rows[0]["reason"].ToString();
                                }
                            }
                            pnlReqDenied.Visible = true;
                        }
                        else if (dsRR.Tables[0].Rows[0]["status"].ToString() == "7")
                        {
                            DataSet dsRRReturn = oResourceRequest.getResourceRequestReturn(intResource, intReturned, Int32.Parse(lblNumber.Text), 0, 0);
                            if (dsRRReturn.Tables[0].Rows.Count > 0)
                            {
                                lblReqReturnedId.Text         = dsRRReturn.Tables[0].Rows[0]["Id"].ToString();
                                lblReqReturnCommentValue.Text = oFunction.FormatText(dsRRReturn.Tables[0].Rows[0]["Comments"].ToString());
                                lblReqReturnedByValue.Text    = oUser.GetName(Int32.Parse(dsRRReturn.Tables[0].Rows[0]["ReturnedByUser"].ToString()));
                                lblReqReturnedByValue.Text    = oUser.GetFullName(Int32.Parse(dsRRReturn.Tables[0].Rows[0]["ReturnedByUser"].ToString()));
                                pnlReqReturn.Visible          = true;
                            }
                            DataSet dsRRReturn2 = oResourceRequest.getResourceRequestReturn(intResource, intReturned, Int32.Parse(lblNumber.Text), 1, 0);
                            if (dsRRReturn2.Tables[0].Rows.Count > 0)
                            {
                                lblReqReturnedId2.Text         = dsRRReturn2.Tables[0].Rows[0]["Id"].ToString();
                                lblReqReturnCommentValue2.Text = oFunction.FormatText(dsRRReturn2.Tables[0].Rows[0]["Comments"].ToString());
                                lblReqReturnedByValue2.Text    = oUser.GetName(Int32.Parse(dsRRReturn2.Tables[0].Rows[0]["ReturnedByUser"].ToString()));
                                lblReqReturnedByValue2.Text    = oUser.GetFullName(Int32.Parse(dsRRReturn2.Tables[0].Rows[0]["ReturnedByUser"].ToString()));
                                pnlReqReturn2.Visible          = true;
                            }
                        }
                        else
                        {
                            pnlReqReturn.Visible  = false;
                            pnlReqReturn2.Visible = false;
                        }
                    }
                }
            }
        }
Exemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProjectRequest  = new ProjectRequest(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oProjectNumber   = new ProjectNumber(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oVariable        = new Variables(intEnvironment);
            oProject         = new Projects(intProfile, dsn);
            oPlatform        = new Platforms(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oRequestField    = new RequestFields(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oLog             = new Log(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["action"] != null && Request.QueryString["action"] != "")
            {
                panFinish.Visible = true;
            }
            else
            {
                if (!IsPostBack)
                {
                    if (Request.QueryString["rrid"] != null && Request.QueryString["rrid"] != "")
                    {
                        // PLATFORM
                        int intResource = Int32.Parse(Request.QueryString["rrid"]);
                        lblRequest.Text = Request.QueryString["rrid"];
                        if (intResource > 0)
                        {
                            DataSet dsResource = oResourceRequest.Get(intResource);
                            if (dsResource.Tables[0].Rows.Count > 0)
                            {
                                int intRequest = Int32.Parse(dsResource.Tables[0].Rows[0]["requestid"].ToString());
                                int intService = Int32.Parse(dsResource.Tables[0].Rows[0]["serviceid"].ToString());
                                int intNumber  = Int32.Parse(dsResource.Tables[0].Rows[0]["number"].ToString());
                                if (oRequest.Allowed(intRequest, intService, intNumber, intProfile, true))
                                {
                                    panRequest.Visible = true;
                                    int intProject = oRequest.GetProjectNumber(intRequest);
                                    int intItem    = Int32.Parse(dsResource.Tables[0].Rows[0]["itemid"].ToString());
                                    int intApp     = oRequestItem.GetItemApplication(intItem);
                                    lblView.Text = oRequestField.GetBodyOverall(intResource, 0, dsnServiceEditor, intEnvironment, dsnAsset, dsnIP);
                                    //LoadProject(intProject, intRequest);
                                }
                                else
                                {
                                    panDenied.Visible = true;
                                }
                            }
                            else
                            {
                                panDenied.Visible = true;
                            }
                        }
                        else
                        {
                            panDenied.Visible = true;
                        }
                    }
                    else if (Request.QueryString["srid"] != null && Request.QueryString["srid"] != "")
                    {
                        // SERVICE
                        int intServiceSelectedID = Int32.Parse(Request.QueryString["srid"]);
                        if (intServiceSelectedID > 0)
                        {
                            DataSet dsServiceSelected = oService.GetSelectedById(intServiceSelectedID);
                            if (dsServiceSelected.Tables[0].Rows.Count > 0)
                            {
                                DataRow drServiceSelected = dsServiceSelected.Tables[0].Rows[0];
                                int     intRequest        = Int32.Parse(drServiceSelected["requestid"].ToString());
                                int     intService        = Int32.Parse(drServiceSelected["serviceid"].ToString());
                                int     intItem           = oService.GetItemId(intService);
                                int     intNumber         = Int32.Parse(drServiceSelected["number"].ToString());
                                if (drServiceSelected["approvedon"].ToString() == "" || drServiceSelected["approved"].ToString() == "0")
                                {
                                    int intApp = oRequestItem.GetItemApplication(intItem);
                                    lblRequest.Text = intRequest.ToString();
                                    if (oRequest.Allowed(intRequest, intService, intNumber, intProfile, true))
                                    {
                                        panRequest.Visible = true;
                                        int intProject = oRequest.GetProjectNumber(intRequest);
                                        lblView.Text = oRequestField.GetBodyNoEnv(intRequest, intItem, intNumber, intService, 0, 0, dsnServiceEditor, intEnvironment, dsnAsset, dsnIP);
                                        //LoadProject(intProject, intRequest);
                                    }
                                    else
                                    {
                                        panDenied.Visible = true;
                                    }
                                }
                                else
                                {
                                    // Already approved
                                    litAlreadyStatus.Text = (drServiceSelected["approved"].ToString() == "1" ? "Approved" : "Denied");
                                    litAlreadyBy.Text     = oUser.GetFullNameWithLanID(Int32.Parse(drServiceSelected["approvedby"].ToString()));
                                    litAlreadyOn.Text     = " on " + drServiceSelected["approvedon"].ToString();
                                    panAlready.Visible    = true;
                                }
                            }
                            else
                            {
                                panDenied.Visible = true;
                            }
                        }
                        else
                        {
                            panDenied.Visible = true;
                        }
                    }
                    else if (Request.QueryString["rid"] != null && Request.QueryString["rid"] != "")
                    {
                        // MANAGER
                        int intRequest = Int32.Parse(Request.QueryString["rid"]);
                        lblRequest.Text = Request.QueryString["rid"];
                        int intProject = Int32.Parse(oRequest.Get(intRequest, "projectid"));
                        //ds = oResourceRequest.GetRequestAll(intRequest);
                        int intRequester = Int32.Parse(oRequest.Get(intRequest, "userid"));
                        if (intRequest > 0)
                        {
                            bool boolAllowed = oUser.IsManager(intRequester, intProfile, true);
                            if (boolAllowed == false)
                            {
                                int intManager = oUser.GetManager(intRequester, true);
                                boolAllowed = (oDelegate.Get(intManager, intProfile) > 0);
                            }
                            if (oUser.IsAdmin(intProfile) || boolAllowed)
                            {
                                trHR.Visible       = false;
                                panRequest.Visible = true;
                                lblView.Text       = "As the manager of <b>" + oUser.GetFullName(intRequester) + "</b>, you will need to approve this request before it is submitted. You can view the details of the request by clicking [<a href=\"javascript:void(0);\">View</a>] next to each item.";
                                Control oControl = (Control)LoadControl("/controls/resource_request_new.ascx");
                                PHForm.Controls.Add(oControl);
                                if (String.IsNullOrEmpty(Request.QueryString["approve"]))
                                {
                                    btnApprove.Visible = btnDeny.Visible = false;
                                    lblView.Text       = "Here are the details of the service request...";
                                }

                                if (oServiceRequest.Get(intRequest, "manager_approval") != "0")
                                {
                                    // Already approved
                                    btnApprove.Enabled    = btnDeny.Enabled = false;
                                    litAlreadyStatus.Text = (oServiceRequest.Get(intRequest, "manager_approval") == "1" ? "Approved" : "Denied");
                                    litAlreadyBy.Text     = oUser.GetFullNameWithLanID(oUser.GetManager(intRequester, true));
                                    panAlready.Visible    = true;
                                }
                            }
                            else
                            {
                                panDenied.Visible = true;
                            }
                        }
                        else
                        {
                            panDenied.Visible = true;
                        }
                    }
                    else
                    {
                        panDenied.Visible = true;
                    }
                }
            }
            btnClose.Attributes.Add("onclick", "return CloseWindow();");
            btnFinish.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
            btnAlready.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
            btnApprove.Attributes.Add("onclick", "return confirm('Are you sure you want to APPROVE this request?') && ProcessButton(this) && LoadWait();");
            btnDeny.Attributes.Add("onclick", "return Deny('" + divDeny.ClientID + "','" + divApprove.ClientID + "','" + txtReason.ClientID + "');");
            btnDone.Attributes.Add("onclick", "return ValidateText('" + txtReason.ClientID + "', 'Please enter a reason') && confirm('Are you sure you want to DENY this request?') && ProcessButton(this) && LoadWait();");
            btnCancel.Attributes.Add("onclick", "return Cancel('" + divDeny.ClientID + "','" + divApprove.ClientID + "');");
        }
        private void LoadRequest()
        {
            // Get Workflow Details
            lblResourceWorkflow.Text = Request.QueryString["rrid"];
            int    intResourceWorkflow = Int32.Parse(Request.QueryString["rrid"]);
            int    intResourceParent   = oResourceRequest.GetWorkflowParent(intResourceWorkflow);
            int    intUser             = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid"));
            bool   boolComplete        = (oResourceRequest.GetWorkflow(intResourceWorkflow, "status") == "3");
            double dblAllocated        = double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated"));
            bool   boolJoined          = (oResourceRequest.GetWorkflow(intResourceWorkflow, "joined") == "1");

            DataSet ds = oResourceRequest.Get(intResourceParent);

            //Project or Task Details
            intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
            intProject = oRequest.GetProjectNumber(intRequest);
            if (intProject > 0)
            {
                lblName.Text   = oProject.Get(intProject, "name");
                lblNumber.Text = oProject.Get(intProject, "number");
                lblType.Text   = "Project";
            }
            else
            {
                lblName.Text   = oResourceRequest.GetWorkflow(intRequest, "name");
                lblNumber.Text = "CVT" + intRequest.ToString();
                lblType.Text   = "Task";
            }

            intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
            intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
            intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
            int intApp = oRequestItem.GetItemApplication(intItem);

            lblService.Text = oService.Get(intService, "name");

            lblRequestedBy.Text = oUser.GetFullName(oRequest.GetUser(intRequest));
            lblRequestedOn.Text = DateTime.Parse(oResourceRequest.Get(intResourceParent, "created")).ToString();
            lblDescription.Text = oRequest.Get(intRequest, "description");
            if (lblDescription.Text == "")
            {
                lblDescription.Text = "<i>No information</i>";
            }

            txtCustom.Text  = oResourceRequest.GetWorkflow(intResourceWorkflow, "name");
            lblUpdated.Text = oResourceRequest.GetUpdated(intResourceParent);


            if (!IsPostBack)
            {
                double dblUsed = oResourceRequest.GetWorkflowUsed(intResourceWorkflow);
                if (dblAllocated == dblUsed)
                {
                    if (boolComplete == false)
                    {
                        btnComplete.Attributes.Add("onclick", "return confirm('Are you sure you want to mark this as completed and remove it from your workload?');");
                    }
                    else
                    {
                        btnComplete.Attributes.Add("onclick", "alert('This task has already been marked COMPLETE. You can close this window.');return false;");
                    }
                }
                else
                {
                    btnComplete.ImageUrl = "/images/tool_complete_dbl.gif";
                    btnComplete.Enabled  = false;
                }
                bool boolSLABreached = false;
                if (oService.Get(intService, "sla") != "")
                {
                    int intDays = oResourceRequest.GetSLA(intResourceParent);
                    if (intDays > -99999)
                    {
                        if (intDays < 1)
                        {
                            btnSLA.Style["border"] = "solid 2px #FF0000";
                        }
                        else if (intDays < 3)
                        {
                            btnSLA.Style["border"] = "solid 2px #FF9999";
                        }
                        boolSLABreached = (intDays < 0);
                        btnSLA.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_SLA','?rrid=" + intResourceParent.ToString() + "');");
                    }
                    else
                    {
                        btnSLA.ImageUrl = "/images/tool_sla_dbl.gif";
                        btnSLA.Enabled  = false;
                    }
                }
                else
                {
                    btnSLA.ImageUrl = "/images/tool_sla_dbl.gif";
                    btnSLA.Enabled  = false;
                }
                btnEmail.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_EMAIL','?rrid=" + intResourceWorkflow.ToString() + "&type=GENERIC');");
                dblUsed = (dblUsed / dblAllocated) * 100;

                panWorkload.Visible = true;
                bool boolRed = LoadStatus(intResourceWorkflow);
                if (boolRed == false && boolSLABreached == true)
                {
                    btnComplete.Attributes.Add("onclick", "alert('NOTE: Your Service Level Agreement (SLA) has been breached!\\n\\nYou must provide a RED STATUS update with an explanation of why your SLA was breached for this request.\\n\\nOnce a RED STATUS update has been provided, you will be able to complete this request.');return false;");
                }

                LoadInformation();
                chkDescription.Checked = (Request.QueryString["doc"] != null);

                //Change Control and Documents
                //ucWMStatusUpdates.RRWorkflowId = intResourceWorkflow;
                LoadChange(intResourceWorkflow);
                lblDocuments.Text = oDocument.GetDocuments_Service(intRequest, intService, oVariable.DocumentsFolder(), 1, (Request.QueryString["doc"] != null));


                // 6/1/2009 - Load ReadOnly View
                if ((oResourceRequest.CanUpdate(intProfile, intResourceWorkflow, false) == false) || boolComplete == true)
                {
                    oFunction.ConfigureToolButtonRO(btnSave, btnComplete);
                }


                btnReturn.Visible = false;
                //btnComplete.Visible = false;
            }

            //div selection
            if (Request.QueryString["div"] != null)
            {
                switch (Request.QueryString["div"])
                {
                case "E":
                    boolExecution = true;
                    break;

                case "C":
                    boolChange = true;
                    break;

                case "D":
                    boolDocuments = true;
                    break;

                case "S":
                    boolStatusUpdates = true;
                    break;
                }
            }
            if (boolDetails == false && boolExecution == false && boolStatusUpdates == false && boolChange == false && boolDocuments == false)
            {
                boolDetails = true;
            }
        }
Exemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProject         = new Projects(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oUser            = new Users(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oRequestField    = new RequestFields(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oServiceDetail   = new ServiceDetails(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oDocument        = new Documents(intProfile, dsn);
            oOnDemandTasks   = new OnDemandTasks(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["rrid"] != null && Request.QueryString["rrid"] != "")
            {
                // Start Workflow Change
                lblResourceWorkflow.Text = Request.QueryString["rrid"];
                int intResourceWorkflow = Int32.Parse(Request.QueryString["rrid"]);
                int intResourceParent   = oResourceRequest.GetWorkflowParent(intResourceWorkflow);
                ds = oResourceRequest.Get(intResourceParent);
                // End Workflow Change
                intRequest          = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                lblRequestedBy.Text = oUser.GetFullName(oRequest.GetUser(intRequest));
                lblRequestedOn.Text = DateTime.Parse(oRequest.Get(intRequest, "created")).ToString();
                lblDescription.Text = oRequest.Get(intRequest, "description");
                if (lblDescription.Text == "")
                {
                    lblDescription.Text = "<i>No information</i>";
                }
                intItem   = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                intNumber = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                // Start Workflow Change
                bool boolComplete = (oResourceRequest.GetWorkflow(intResourceWorkflow, "status") == "3");
                int  intUser      = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid"));
                txtCustom.Text = oResourceRequest.GetWorkflow(intResourceWorkflow, "name");
                double dblAllocated = double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated"));
                boolJoined = (oResourceRequest.GetWorkflow(intResourceWorkflow, "joined") == "1");
                // End Workflow Change
                intService      = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                lblService.Text = oService.Get(intService, "name");
                int intApp = oRequestItem.GetItemApplication(intItem);

                if (Request.QueryString["save"] != null && Request.QueryString["save"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Information Saved Successfully');<" + "/" + "script>");
                }
                if (Request.QueryString["status"] != null && Request.QueryString["status"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Weekly Status has been Added');<" + "/" + "script>");
                }
                if (!IsPostBack)
                {
                    double dblUsed = oResourceRequest.GetWorkflowUsed(intResourceWorkflow);
                    lblUpdated.Text = oResourceRequest.GetUpdated(intResourceParent);
                    if (dblAllocated == dblUsed)
                    {
                        if (boolComplete == false)
                        {
                            oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                            btnComplete.Attributes.Add("onclick", "return confirm('Are you sure you want to mark this as completed and remove it from your workload?');");
                        }
                        else
                        {
                            oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                            btnComplete.Attributes.Add("onclick", "alert('This task has already been marked COMPLETE. You can close this window.');return false;");
                        }
                    }
                    else
                    {
                        btnComplete.ImageUrl = "/images/tool_complete_dbl.gif";
                        btnComplete.Enabled  = false;
                    }
                    if (oService.Get(intService, "sla") != "")
                    {
                        oFunction.ConfigureToolButton(btnSLA, "/images/tool_sla");
                        int intDays = oResourceRequest.GetSLA(intResourceParent);
                        if (intDays < 1)
                        {
                            btnSLA.Style["border"] = "solid 2px #FF0000";
                        }
                        else if (intDays < 3)
                        {
                            btnSLA.Style["border"] = "solid 2px #FF9999";
                        }
                        btnSLA.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_SLA','?rrid=" + intResourceParent.ToString() + "');");
                    }
                    else
                    {
                        btnSLA.ImageUrl = "/images/tool_sla_dbl.gif";
                        btnSLA.Enabled  = false;
                    }
                    oFunction.ConfigureToolButton(btnEmail, "/images/tool_email");
                    btnEmail.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_EMAIL','?rrid=" + intResourceWorkflow.ToString() + "&type=GENERIC');");
                    dblUsed       = (dblUsed / dblAllocated) * 100;
                    strCheckboxes = oServiceDetail.LoadCheckboxes(intRequest, intItem, intNumber, intResourceWorkflow, intService);
                    if (oService.Get(intService, "tasks") != "1" || strCheckboxes == "")
                    {
                        if (oService.Get(intService, "no_slider") == "1")
                        {
                            panNoSlider.Visible  = true;
                            btnComplete.ImageUrl = "/images/tool_complete.gif";
                            btnComplete.Enabled  = true;
                            btnComplete.Attributes.Add("onclick", "return confirm('Are you sure you want to mark this as completed and remove it from your workload?');");
                            btnComplete.CommandArgument = "FAST";
                        }
                        else
                        {
                            panSlider.Visible      = true;
                            sldHours._StartPercent = dblUsed.ToString();
                            sldHours._TotalHours   = dblAllocated.ToString();
                        }
                    }
                    else
                    {
                        panCheckboxes.Visible = true;
                    }
                    intProject          = oRequest.GetProjectNumber(intRequest);
                    hdnTab.Value        = "D";
                    panWorkload.Visible = true;
                    LoadStatus(intResourceWorkflow);
                    LoadChange(intResourceWorkflow);
                    LoadInformation(intResourceWorkflow);
                    chkDescription.Checked = (Request.QueryString["doc"] != null);
                    lblDocuments.Text      = oDocument.GetDocuments_Request(intRequest, 0, Request.PhysicalApplicationPath, 1, (Request.QueryString["doc"] != null));
                    // GetDocuments(string _physical, int _projectid, int _requestid, int _userid, int _security, bool _show_description, bool _mine)
                    //lblDocuments.Text = oDocument.GetDocuments(Request.PhysicalApplicationPath, 0, intRequest, 0, 1, (Request.QueryString["doc"] != null), false);

                    btnDenied.Attributes.Add("onclick", "return CloseWindow();");
                    oFunction.ConfigureToolButton(btnSave, "/images/tool_save");
                    oFunction.ConfigureToolButton(btnPrint, "/images/tool_print");
                    btnPrint.Attributes.Add("onclick", "return PrintWindow();");
                    oFunction.ConfigureToolButton(btnClose, "/images/tool_close");
                    btnClose.Attributes.Add("onclick", "return ExitWindow();");
                    btnSave.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "');");
                    btnChange.Attributes.Add("onclick", "return ValidateText('" + txtNumber.ClientID + "','Please enter a change control number')" +
                                             " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid implementation date')" +
                                             " && ValidateTime('" + txtTime.ClientID + "','Please enter a valid implementation time')" +
                                             ";");
                    imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
                    // 6/1/2009 - Load ReadOnly View
                    if (oResourceRequest.CanUpdate(intProfile, intResourceWorkflow, false) == false)
                    {
                        oFunction.ConfigureToolButtonRO(btnSave, btnComplete);
                        //panDenied.Visible = true;
                    }
                }
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Exemplo n.º 23
0
        protected void LoadRequest()
        {
            int intRequest   = Int32.Parse(Request.QueryString["rid"]);
            int intProject   = oRequest.GetProjectNumber(intRequest);
            int intApproved  = (oProject.IsApproved(intProject) ? 1 : 0);
            int intExecutive = 0;
            int intWorking   = 0;

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

            if (dsProjectRequest.Tables[0].Rows.Count > 0 && intApproved == 1)
            {
                int intProjectRequest = Int32.Parse(dsProjectRequest.Tables[0].Rows[0]["requestid"].ToString());
                txtStatement.Text = oRequest.Get(intProjectRequest, "description");
                txtStart.Text     = DateTime.Parse(oRequest.Get(intProjectRequest, "start_date")).ToShortDateString();
                txtEnd.Text       = DateTime.Parse(oRequest.Get(intProjectRequest, "end_date")).ToShortDateString();
            }
            else
            {
                DataSet       dsProject     = oProject.Get(intProject);
                Organizations oOrganization = new Organizations(intProfile, dsn);
                if (dsProject.Tables[0].Rows.Count > 0)
                {
                    int     intItem = Int32.Parse(lblItem.Text);
                    DataSet ds      = oCustomized.GetTPMServiceRequests(intProject, intItem);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        LoadPrevious(ds);
                    }
                    else
                    {
                        int intApp = oRequestItem.GetItemApplication(intItem);
                        ds = oCustomized.GetTPMServiceRequestsApplication(intProject, intApp);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            LoadPrevious(ds);
                        }
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProjectRequest  = new ProjectRequest(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oProjectNumber   = new ProjectNumber(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oService         = new Services(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oEnhancement     = new Enhancements(intProfile, dsn);
            oLog             = new Log(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);

            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.QueryString["action"] != null && Request.QueryString["action"] != "")
            {
                panFinish.Visible = true;
            }
            else
            {
                if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
                {
                    intApplication = Int32.Parse(Request.QueryString["applicationid"]);
                }
                if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
                {
                    intApplication = Int32.Parse(Request.Cookies["application"].Value);
                }
                if (!IsPostBack)
                {
                    if (Request.QueryString["rrid"] != null && Request.QueryString["rrid"] != "")
                    {
                        lblResourceParent.Text = Request.QueryString["rrid"];
                        int intResourceParent = Int32.Parse(lblResourceParent.Text);
                        ds = oResourceRequest.Get(intResourceParent);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            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());
                            int      intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                            Forecast oForecast  = new Forecast(intProfile, dsn);
                            if (intService == intStorageService)
                            {
                                try
                                {
                                    OnDemandTasks oOnDemandTask = new OnDemandTasks(0, dsn);
                                    Locations     oLocation     = new Locations(0, dsn);
                                    DataSet       dsDesign      = oOnDemandTask.GetServerStorage(intRequest, intItem, intNumber);
                                    if (dsDesign.Tables[0].Rows.Count == 1)
                                    {
                                        int intAnswer  = Int32.Parse(dsDesign.Tables[0].Rows[0]["answerid"].ToString());
                                        int intAddress = Int32.Parse(oForecast.GetAnswer(intAnswer, "addressid"));
                                        lblLocation.Text    = oLocation.GetFull(intAddress);
                                        panLocation.Visible = true;
                                    }
                                }
                                catch { }
                            }
                            int     intProject  = Int32.Parse(oRequest.Get(intRequest, "projectid"));
                            int     intApp      = oRequestItem.GetItemApplication(intItem);
                            int     intForecast = 0;
                            DataSet dsForecast  = oForecast.GetProject(intProject);
                            if (dsForecast.Tables[0].Rows.Count > 0)
                            {
                                intForecast = Int32.Parse(dsForecast.Tables[0].Rows[0]["id"].ToString());
                            }
                            if (intForecast > 0)
                            {
                                btnView.Attributes.Add("oncontextmenu", "return OpenWindow('NEW_WINDOW','" + oPage.GetFullLink(intDesignBuilder) + "?id=" + intForecast.ToString() + "');");
                            }
                            else
                            {
                                btnView.Attributes.Add("oncontextmenu", "alert('There is no design for this project');return false;");
                            }
                            if (ds.Tables[0].Rows[0]["solo"].ToString() == "0")
                            {
                                btnView.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewRequest.ToString() + "&rid=" + intRequest.ToString() + "');");
                                btnView.Text = "Click here to view the project details";
                                lblType.Text = "Project Request";
                            }
                            else
                            {
                                btnView.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewResourceRequest.ToString() + "&rrid=" + intResourceParent.ToString() + "');");
                                if (oApplication.Get(intApp, "tpm") == "1")
                                {
                                    btnView.Text = "Click here to view the project details";
                                }
                                else
                                {
                                    btnView.Text = "Click here to view this request";
                                }
                                lblType.Text = "Service Request";
                            }
                            btnAssignments.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intSearchPage.ToString() + "&pid=" + intProject + "&aid=" + intApp.ToString() + "&sort=userid');");
                            //btnAssignments.Attributes.Add("onclick", "return OpenNewWindowMenu('/datapoint/projects/datapoint_projects.aspx?id=" + oFunction.encryptQueryString(intProject.ToString()) + "', '800', '600');");
                            lblItem.Text    = intItem.ToString();
                            lblService.Text = oService.GetName(intService);
                            if (oApplication.Get(intApp, "request_items") == "1")
                            {
                                lblGroup.Text = oApplication.GetName(intApp) + " | " + oRequestItem.GetItemName(intItem);
                            }
                            else
                            {
                                lblGroup.Text = oApplication.GetName(intApp);
                            }
                            int intUser       = Int32.Parse(oRequest.Get(intRequest, "userid"));
                            int intAppManager = oApplication.GetManager(intApp);
                            if (ds.Tables[0].Rows[0]["accepted"].ToString() == "-1" && oApplication.Get(intApp, "tpm") == "1")
                            {
                                if (intUser == intProfile || oDelegate.Get(intUser, intProfile) > 0)
                                {
                                    panRequest.Visible      = true;
                                    panAssignSingle.Visible = true;
                                    txtHours.Text           = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    panHours.Visible        = !(oApplication.Get(intApp, "tpm") == "1");
                                    txtHours.Enabled        = (oService.Get(intService, "disable_hours") == "1" ? false : true);
                                    lblQuantity.Text        = ds.Tables[0].Rows[0]["devices"].ToString();
                                    lblStatus.Text          = oStatusLevel.HTML(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                                    panQuantity.Visible     = (lblQuantity.Text != "0");
                                    txtQuantity.Text        = lblQuantity.Text;
                                    txtQuantity.Enabled     = (txtQuantity.Text != "0");
                                    txtQuantity.Enabled     = false;
                                    lblAssign.Text          = oUser.GetFullName(intProfile);
                                    strSummary = oResourceRequest.GetBodyOverallFix(intResourceParent, 0, intEnvironment, false);
                                }
                                else
                                {
                                    Response.Write("no rights");
                                    panDenied.Visible = true;
                                }
                                btnSubmit.Attributes.Add("onclick", "return ValidateNumber0('" + txtHours.ClientID + "','Please enter a valid number for the hours allocated') && ValidateHidden('" + hdnManager.ClientID + "','" + txtManager.ClientID + "','Please enter a valid LAN ID') && ProcessButton(this);");
                            }
                            else
                            {
                                string strValidate = "";
                                if (oUser.IsAdmin(intProfile) || oService.IsManager(intService, intProfile) || (oApplication.IsManager(intApp, intProfile) && oApplication.Get(intApp, "disable_manager") != "1"))
                                {
                                    panRequest.Visible        = true;
                                    panAssignMultiple.Visible = true;
                                    btnSubmit.Enabled         = (ds.Tables[0].Rows[0]["assigned"].ToString() == "");
                                    if (ds.Tables[0].Rows[0]["status"].ToString() == "5")
                                    {
                                        radHold.Checked            = true;
                                        divChoice.Style["display"] = "inline";
                                        divHold.Style["display"]   = "inline";
                                        txtHold.Text = ds.Tables[0].Rows[0]["reason"].ToString();
                                    }
                                    else
                                    {
                                        divChoice.Style["display"] = (ds.Tables[0].Rows[0]["accepted"].ToString() == "0" ? "inline" : "none");
                                        divAccept.Style["display"] = (ds.Tables[0].Rows[0]["accepted"].ToString() == "1" ? "inline" : "none");
                                    }
                                    int intEnhancementService = 0;
                                    Int32.TryParse(ConfigurationManager.AppSettings["HELP_ENHANCEMENT_SERVICEID"], out intEnhancementService);
                                    if (intService == intEnhancementService)
                                    {
                                        panEnhancement.Visible   = true;
                                        ddlModule.DataTextField  = "name";
                                        ddlModule.DataValueField = "id";
                                        ddlModule.DataSource     = oEnhancement.GetModules(1);
                                        ddlModule.DataBind();
                                        ddlModule.Items.Insert(0, new ListItem("-- SELECT --", "0"));

                                        strValidate += "ValidateDropDown('" + ddlModule.ClientID + "','Select a classification') && ";
                                        radEnhancementShort.Checked = true;
                                        radEnhancementReject.Attributes.Add("onclick", "ShowHideDiv('" + trEnhancementReject.ClientID + "','inline');ShowHideDiv('" + trEnhancementClassification.ClientID + "','none');ShowHideDiv('" + divAccept.ClientID + "','none');");
                                        radEnhancementDuplicate.Attributes.Add("onclick", "ShowHideDiv('" + trEnhancementReject.ClientID + "','inline');ShowHideDiv('" + trEnhancementClassification.ClientID + "','none');ShowHideDiv('" + divAccept.ClientID + "','none');");
                                        radEnhancementShort.Attributes.Add("onclick", "ShowHideDiv('" + trEnhancementReject.ClientID + "','none');ShowHideDiv('" + trEnhancementClassification.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','inline');");
                                        radEnhancementLong.Attributes.Add("onclick", "ShowHideDiv('" + trEnhancementReject.ClientID + "','inline');ShowHideDiv('" + trEnhancementClassification.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','inline');");
                                    }
                                    panDelete.Visible = (intItem == intImplementorDistributed || intItem == intImplementorMidrange);
                                    btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this request');");
                                    txtHours.Text       = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    panHours.Visible    = !(oApplication.Get(intApp, "tpm") == "1");
                                    txtHours.Enabled    = (oService.Get(intService, "disable_hours") == "1" ? false : true);
                                    lblQuantity.Text    = ds.Tables[0].Rows[0]["devices"].ToString();
                                    panQuantity.Visible = (lblQuantity.Text != "0");
                                    txtQuantity.Text    = lblQuantity.Text;
                                    txtQuantity.Enabled = (txtQuantity.Text != "0");
                                    txtQuantity.Enabled = false;
                                    lblStatus.Text      = oStatusLevel.HTML(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                                    trAssigned.Visible  = !(btnSubmit.Enabled);
                                    string  strAssign = "";
                                    DataSet dsManager = oService.GetUser(intService, 1);
                                    foreach (DataRow drManager in dsManager.Tables[0].Rows)
                                    {
                                        if (strAssign != "")
                                        {
                                            strAssign += ", ";
                                        }
                                        strAssign += oUser.GetFullName(Int32.Parse(drManager["userid"].ToString()));
                                    }
                                    lblAssign.Text = strAssign;
                                    DataSet   dsReports = oUser.GetManagerReports(intAppManager, intRequest, intService, intNumber);
                                    DataTable dtReports = dsReports.Tables[0].Copy();
                                    dtReports.Clear();
                                    DataSet dsAssignment = oService.GetUser(intService, -100);
                                    foreach (DataRow drAssignment in dsAssignment.Tables[0].Rows)
                                    {
                                        int     intAssignment = Int32.Parse(drAssignment["userid"].ToString());
                                        DataSet dsAssignees   = oUser.GetManagerReports(intAssignment, intRequest, intService, intNumber);
                                        foreach (DataRow drAssignee in dsAssignees.Tables[0].Rows)
                                        {
                                            dtReports.ImportRow(drAssignee);
                                        }
                                    }
                                    if (dtReports.Rows.Count > 0)
                                    {
                                        // Use custom assignment list
                                        // First, remove duplicates
                                        Hashtable hTable        = new Hashtable();
                                        ArrayList duplicateList = new ArrayList();
                                        foreach (DataRow drow in dtReports.Rows)
                                        {
                                            if (hTable.Contains(drow["userid"]))
                                            {
                                                duplicateList.Add(drow);
                                            }
                                            else
                                            {
                                                hTable.Add(drow["userid"], string.Empty);
                                            }
                                        }
                                        foreach (DataRow dRow in duplicateList)
                                        {
                                            dtReports.Rows.Remove(dRow);
                                        }

                                        // Next, sort by username
                                        dtReports.DefaultView.Sort = "username";

                                        // Now add to dataset
                                        dsReports = new DataSet();
                                        dsReports.Tables.Add(dtReports.DefaultView.ToTable());
                                    }
                                    LoadList(dsReports, intApp);
                                    LoadAvailable(dsReports, intApp);
                                    strSummary = oResourceRequest.GetBodyOverallFix(intResourceParent, 0, intEnvironment, false);
                                }
                                else
                                {
                                    Response.Write("no delegate");
                                    panDenied.Visible = true;
                                }
                                btnSubmit.Attributes.Add("onclick", "return " + strValidate + "ValidateChoice('" + divChoice.ClientID + "','" + radAccept.ClientID + "','" + radReject.ClientID + "','" + radHold.ClientID + "','" + ddlUser.ClientID + "','" + txtHours.ClientID + "') && ProcessButton(this);");
                            }
                        }
                        else
                        {
                            panDenied.Visible = true;
                        }
                    }
                    else
                    {
                        panDenied.Visible = true;
                    }
                }
            }
            btnClose.Attributes.Add("onclick", "return CloseWindow();");
            lnkAvailable.Attributes.Add("onclick", "return ShowHideAvailable('" + divAvailable.ClientID + "');");
            radAccept.Attributes.Add("onclick", "ShowHideDiv('" + divAccept.ClientID + "','inline');ShowHideDiv('" + divReject.ClientID + "','none');ShowHideDiv('" + divHold.ClientID + "','none');");
            radReject.Attributes.Add("onclick", "ShowHideDiv('" + divReject.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','none');ShowHideDiv('" + divHold.ClientID + "','none');");
            radHold.Attributes.Add("onclick", "ShowHideDiv('" + divHold.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','none');ShowHideDiv('" + divReject.ClientID + "','none');");
            txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divManager.ClientID + "','" + lstManager.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstManager.Attributes.Add("ondblclick", "AJAXClickRow();");
        }
Exemplo n.º 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProject         = new Projects(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oUser            = new Users(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oRequestField    = new RequestFields(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oServiceDetail   = new ServiceDetails(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oCustomized      = new Customized(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oClass           = new Classes(intProfile, dsn);
            oEnvironment     = new Environments(intProfile, dsn);
            oLocation        = new Locations(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["rrid"] != null && Request.QueryString["rrid"] != "")
            {
                // Start Workflow Change
                lblResourceWorkflow.Text = Request.QueryString["rrid"];
                int intResourceWorkflow = Int32.Parse(Request.QueryString["rrid"]);
                int intResourceParent   = oResourceRequest.GetWorkflowParent(intResourceWorkflow);
                ds = oResourceRequest.Get(intResourceParent);
                // End Workflow Change
                intRequest          = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                lblRequestedBy.Text = oUser.GetFullName(oRequest.GetUser(intRequest));
                lblRequestedOn.Text = DateTime.Parse(oResourceRequest.Get(intResourceParent, "created")).ToString();
                intItem             = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                intNumber           = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                // Start Workflow Change
                bool boolComplete = (oResourceRequest.GetWorkflow(intResourceWorkflow, "status") == "3");
                int  intUser      = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid"));
                txtCustom.Text = oResourceRequest.GetWorkflow(intResourceWorkflow, "name");
                double dblAllocated = double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated"));
                // End Workflow Change
                intService      = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                lblService.Text = oService.Get(intService, "name");
                int intApp = oRequestItem.GetItemApplication(intItem);

                if (Request.QueryString["save"] != null && Request.QueryString["save"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Information Saved Successfully');<" + "/" + "script>");
                }
                if (Request.QueryString["status"] != null && Request.QueryString["status"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Status Updates has been Added');<" + "/" + "script>");
                }
                if (!IsPostBack)
                {
                    double dblUsed = oResourceRequest.GetWorkflowUsed(intResourceWorkflow);
                    lblUpdated.Text = oResourceRequest.GetUpdated(intResourceWorkflow);
                    if (dblAllocated == dblUsed)
                    {
                        if (boolComplete == false)
                        {
                            oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                            btnComplete.Attributes.Add("onclick", "return confirm('Are you sure you want to mark this as completed and remove it from your workload?');");
                        }
                        else
                        {
                            oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                            btnComplete.Attributes.Add("onclick", "alert('This task has already been marked COMPLETE. You can close this window.');return false;");
                        }
                        panComplete.Visible = true;
                    }
                    else
                    {
                        btnComplete.ImageUrl = "/images/tool_complete_dbl.gif";
                        btnComplete.Enabled  = false;
                    }
                    dblUsed             = (dblUsed / dblAllocated) * 100;
                    intProject          = oRequest.GetProjectNumber(intRequest);
                    hdnTab.Value        = "D";
                    panWorkload.Visible = true;
                    LoadStatus(intResourceWorkflow);
                    LoadInformation(intResourceWorkflow);
                    LoadDetails();

                    btnDenied.Attributes.Add("onclick", "return CloseWindow();");
                    oFunction.ConfigureToolButton(btnSave, "/images/tool_save");
                    oFunction.ConfigureToolButton(btnPrint, "/images/tool_print");
                    btnPrint.Attributes.Add("onclick", "return PrintWindow();");
                    oFunction.ConfigureToolButton(btnClose, "/images/tool_close");
                    btnClose.Attributes.Add("onclick", "return ExitWindow();");
                    btnSave.Attributes.Add("onclick", "return ValidateNumber0('" + txtAmount.ClientID + "','Please enter the total amount of storage')" +
                                           " && ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "')" +
                                           ";");
                    // 6/1/2009 - Load ReadOnly View
                    if (oResourceRequest.CanUpdate(intProfile, intResourceWorkflow, false) == false)
                    {
                        oFunction.ConfigureToolButtonRO(btnSave, btnComplete);
                        //panDenied.Visible = true;
                    }
                }
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Exemplo n.º 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oUser            = new Users(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oAccountRequest  = new AccountRequest(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oService         = new Services(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);
            }
            string strAttributes  = "";
            bool   boolIncomplete = false;

            if (Request.QueryString["rrid"] != null && Request.QueryString["rrid"] != "")
            {
                intResourceWorkflow = Int32.Parse(Request.QueryString["rrid"]);
                int     intResourceParent = oResourceRequest.GetWorkflowParent(intResourceWorkflow);
                DataSet ds = oResourceRequest.Get(intResourceParent);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                    intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                    intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                    // Workflow start
                    bool   boolComplete = (oResourceRequest.GetWorkflow(intResourceWorkflow, "status") == "3");
                    int    intUser      = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid"));
                    double dblAllocated = double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated"));
                    // Workflow end
                    intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                    int intApp = oRequestItem.GetItemApplication(intItem);

                    if (Request.QueryString["save"] != null && Request.QueryString["save"] != "")
                    {
                        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Information Saved Successfully');<" + "/" + "script>");
                    }
                    if (oService.Get(intService, "sla") != "")
                    {
                        oFunction.ConfigureToolButton(btnSLA, "/images/tool_sla");
                        int intDays = oResourceRequest.GetSLA(intResourceParent);
                        if (intDays < 1)
                        {
                            btnSLA.Style["border"] = "solid 2px #FF0000";
                        }
                        else if (intDays < 3)
                        {
                            btnSLA.Style["border"] = "solid 2px #FF9999";
                        }
                        btnSLA.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_SLA','?rrid=" + intResourceParent.ToString() + "');");
                    }
                    else
                    {
                        btnSLA.ImageUrl = "/images/tool_sla_dbl.gif";
                        btnSLA.Enabled  = false;
                    }
                    if (!IsPostBack)
                    {
                        if (intResourceWorkflow > 0)
                        {
                            ds = oRequest.Get(intRequest);
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                ds = oAccountRequest.GetMaintenance(intRequest, intItem, intNumber);
                                if (ds.Tables[0].Rows.Count > 0)
                                {
                                    if (ds.Tables[0].Rows[0]["completed"].ToString() == "")
                                    {
                                        boolIncomplete = true;
                                    }
                                    else
                                    {
                                        lblComplete.Text    = ds.Tables[0].Rows[0]["completed"].ToString();
                                        panComplete.Visible = true;
                                    }
                                    lblRequestBy.Text = oUser.GetFullName(oRequest.GetUser(intRequest));
                                    lblRequestOn.Text = DateTime.Parse(oRequest.Get(intRequest, "created")).ToLongDateString();
                                    int     intDomain = Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString());
                                    Domains oDomain   = new Domains(intProfile, dsn);
                                    intDomain = Int32.Parse(oDomain.Get(intDomain, "environment"));
                                    AD      oAD          = new AD(intProfile, dsn, intDomain);
                                    DataSet dsParameters = oAccountRequest.GetMaintenanceParameters(intRequest, intItem, intNumber);
                                    switch (ds.Tables[0].Rows[0]["maintenance"].ToString())
                                    {
                                    case "DISABLE":
                                        lblType.Text = "Account Disable";
                                        strDetails  += "<tr><td><b>Account:</b></td><td>" + ds.Tables[0].Rows[0]["username"].ToString() + " (" + oAD.GetUserFullName(ds.Tables[0].Rows[0]["username"].ToString()) + ")</td>";
                                        strDetails  += "<tr><td><b>Domain:</b></td><td>" + oDomain.Get(Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString()), "name") + "</td>";
                                        break;

                                    case "UNLOCK":
                                        lblType.Text = "Account Unlock";
                                        strDetails  += "<tr><td><b>Account:</b></td><td>" + ds.Tables[0].Rows[0]["username"].ToString() + " (" + oAD.GetUserFullName(ds.Tables[0].Rows[0]["username"].ToString()) + ")</td>";
                                        strDetails  += "<tr><td><b>Domain:</b></td><td>" + oDomain.Get(Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString()), "name") + "</td>";
                                        break;

                                    case "ENABLE":
                                        lblType.Text = "Account Enable";
                                        strDetails  += "<tr><td><b>Account:</b></td><td>" + ds.Tables[0].Rows[0]["username"].ToString() + " (" + oAD.GetUserFullName(ds.Tables[0].Rows[0]["username"].ToString()) + ")</td>";
                                        strDetails  += "<tr><td><b>Domain:</b></td><td>" + oDomain.Get(Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString()), "name") + "</td>";
                                        break;

                                    case "EMAIL":
                                        lblType.Text = "Email Enable an Account";
                                        strDetails  += "<tr><td><b>Account:</b></td><td>" + ds.Tables[0].Rows[0]["username"].ToString() + " (" + oAD.GetUserFullName(ds.Tables[0].Rows[0]["username"].ToString()) + ")</td>";
                                        strDetails  += "<tr><td><b>Domain:</b></td><td>" + oDomain.Get(Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString()), "name") + "</td>";
                                        break;

                                    case "MOVE":
                                        lblType.Text = "Account Move";
                                        strDetails  += "<tr><td><b>Account:</b></td><td>" + ds.Tables[0].Rows[0]["username"].ToString() + " (" + oAD.GetUserFullName(ds.Tables[0].Rows[0]["username"].ToString()) + ")</td>";
                                        strDetails  += "<tr><td><b>Domain:</b></td><td>" + oDomain.Get(Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString()), "name") + "</td>";
                                        strDetails  += "<tr><td><b>New Location:</b></td><td>" + dsParameters.Tables[0].Rows[0]["value"].ToString() + "</td>";
                                        break;

                                    case "PASSWORD":
                                        lblType.Text = "Account Password Change";
                                        strDetails  += "<tr><td><b>Account:</b></td><td>" + ds.Tables[0].Rows[0]["username"].ToString() + " (" + oAD.GetUserFullName(ds.Tables[0].Rows[0]["username"].ToString()) + ")</td>";
                                        strDetails  += "<tr><td><b>Domain:</b></td><td>" + oDomain.Get(Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString()), "name") + "</td>";
                                        break;

                                    case "COPY":
                                        lblType.Text        = "Account Copy";
                                        panPassword.Visible = true;
                                        strAttributes      += "ValidateText('" + txtPassword.ClientID + "','Please enter a password') && ";
                                        strDetails         += "<tr><td><b>Account:</b></td><td>" + ds.Tables[0].Rows[0]["username"].ToString() + " (" + oAD.GetUserFullName(ds.Tables[0].Rows[0]["username"].ToString()) + ")</td>";
                                        strDetails         += "<tr><td><b>Domain:</b></td><td>" + oDomain.Get(Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString()), "name") + "</td>";
                                        panID.Visible       = true;
                                        txtID.Text          = dsParameters.Tables[0].Rows[0]["value"].ToString();
                                        panFirst.Visible    = true;
                                        txtFirst.Text       = dsParameters.Tables[0].Rows[1]["value"].ToString();
                                        panLast.Visible     = true;
                                        txtLast.Text        = dsParameters.Tables[0].Rows[2]["value"].ToString();
                                        panGroups.Visible   = true;
                                        string[] strGroups;
                                        char[]   strSplit = { ';' };
                                        strGroups = dsParameters.Tables[0].Rows[3]["value"].ToString().Split(strSplit);
                                        for (int ii = 0; ii < strGroups.Length; ii++)
                                        {
                                            if (strGroups[ii].Trim() != "")
                                            {
                                                ListItem oList = new ListItem(strGroups[ii].Trim());
                                                chkGroups.Items.Add(oList);
                                                oList.Selected = true;
                                            }
                                        }
                                        break;

                                    case "DELETE":
                                        lblType.Text = "Account Deletion";
                                        strDetails  += "<tr><td><b>Account:</b></td><td>" + ds.Tables[0].Rows[0]["username"].ToString() + " (" + oAD.GetUserFullName(ds.Tables[0].Rows[0]["username"].ToString()) + ")</td>";
                                        strDetails  += "<tr><td><b>Domain:</b></td><td>" + oDomain.Get(Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString()), "name") + "</td>";
                                        break;

                                    case "RENAME":
                                        lblType.Text     = "Account Rename";
                                        strDetails      += "<tr><td><b>Account:</b></td><td>" + ds.Tables[0].Rows[0]["username"].ToString() + " (" + oAD.GetUserFullName(ds.Tables[0].Rows[0]["username"].ToString()) + ")</td>";
                                        strDetails      += "<tr><td><b>Domain:</b></td><td>" + oDomain.Get(Int32.Parse(ds.Tables[0].Rows[0]["domain"].ToString()), "name") + "</td>";
                                        panID.Visible    = true;
                                        txtID.Text       = dsParameters.Tables[0].Rows[0]["value"].ToString();
                                        panFirst.Visible = true;
                                        txtFirst.Text    = dsParameters.Tables[0].Rows[1]["value"].ToString();
                                        panLast.Visible  = true;
                                        txtLast.Text     = dsParameters.Tables[0].Rows[2]["value"].ToString();
                                        break;

                                    default:
                                        lblType.Text = "Unavailable";
                                        strDetails  += "<tr><td colspan=\"2\"><b>Invalid Maintenance Code!</b></td>";
                                        break;
                                    }
                                    panWorkload.Visible = true;
                                }
                                else
                                {
                                    panDenied.Visible = true;
                                }
                            }
                            else
                            {
                                panDenied.Visible = true;
                            }
                        }
                        else
                        {
                            panDenied.Visible = true;
                        }

                        btnDenied.Attributes.Add("onclick", "return CloseWindow();");
                        oFunction.ConfigureToolButton(btnApprove, "/images/tool_approve");
                        oFunction.ConfigureToolButton(btnDeny, "/images/tool_deny");
                        if (boolIncomplete == true)
                        {
                            btnApprove.Attributes.Add("onclick", "return " + strAttributes + "confirm('Are you sure you want to APPROVE this request?');");
                            btnDeny.Attributes.Add("onclick", "return ValidateText('" + txtComments.ClientID + "','Please enter a reason') && confirm('Are you sure you want to DENY this request?');");
                        }
                        else
                        {
                            btnApprove.Attributes.Add("onclick", "alert('This request has already been completed.\\n\\nIf this request continues to appear in your work queue, please contact a ClearView administrator.');return false;");
                            btnDeny.Attributes.Add("onclick", "alert('This request has already been completed.\\n\\nIf this request continues to appear in your work queue, please contact a ClearView administrator.');return false;");
                        }
                        oFunction.ConfigureToolButton(btnPrint, "/images/tool_print");
                        btnPrint.Attributes.Add("onclick", "return PrintWindow();");
                        oFunction.ConfigureToolButton(btnClose, "/images/tool_close");
                        btnClose.Attributes.Add("onclick", "return ExitWindow();");
                        // 6/1/2009 - Load ReadOnly View
                        if (oResourceRequest.CanUpdate(intProfile, intResourceWorkflow, false) == false)
                        {
                            oFunction.ConfigureToolButtonRO(btnApprove, btnDeny);
                            //panDenied.Visible = true;
                        }
                    }
                }
                else
                {
                    panDenied.Visible = true;
                }
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Exemplo n.º 27
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);
            oRequest     = new Requests(intProfile, dsn);
            oServer      = new Servers(intProfile, dsn);
            oClass       = new Classes(intProfile, dsn);
            oApplication = new Applications(intProfile, dsn);
            oForecast    = new Forecast(intProfile, dsn);
            oFunction    = new Functions(intProfile, dsn, intEnvironment);
            oUser        = new Users(intProfile, dsn);
            oDNS         = new DNS(intProfile, dsn);
            Variables oVariableUser = new Variables(intEnvironment);

            if (intEnvironment < 3)
            {
                intEnvironment = 3;
            }
            oVariable       = new Variables(intEnvironment);
            oSetting        = new Settings(0, dsn);
            boolDNS_QIP     = oSetting.IsDNS_QIP();
            boolDNS_Bluecat = oSetting.IsDNS_Bluecat();
            trQIP.Visible   = boolDNS_QIP;

            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();
                int    intItem        = Int32.Parse(lblItem.Text);
                int    intNumber      = Int32.Parse(lblNumber.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 + "');");
                }
                DataSet ds = oDNS.GetDNS(intRequest, intItem, intNumber);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (!IsPostBack)
                    {
                        LoadServer(ds.Tables[0].Rows[0]);
                    }
                }
                else
                {
                    panSearch.Visible  = true;
                    btnReset.Enabled   = false;
                    btnConfirm.Visible = false;
                    btnNext.Visible    = false;
                }
                btnContinue.Attributes.Add("onclick", "return EnsureDNS('" + txtSearchName.ClientID + "','" + txtSearchIP.ClientID + "','" + txtSearchAlias.ClientID + "')" +
                                           " && ProcessButton(this)" +
                                           ";");
                btnReset.Attributes.Add("onclick", "return ProcessButton(this)" +
                                        ";");
            }
            txtSearchName.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnContinue.ClientID + "').click();return false;}} else {return true}; ");
            txtSearchIP.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnContinue.ClientID + "').click();return false;}} else {return true}; ");
            txtSearchAlias.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnContinue.ClientID + "').click();return false;}} else {return true}; ");
            txtAlias.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnAdd.ClientID + "').click();return false;}} else {return true}; ");
            btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
        }
Exemplo n.º 28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AuthenticateUser();
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oResourceRequest = new ResourceRequest(intProfile, dsn);
     oRequestItem     = new RequestItems(intProfile, dsn);
     oApplication     = new Applications(intProfile, dsn);
     oRequest         = new Requests(intProfile, dsn);
     oProject         = new Projects(intProfile, dsn);
     oProjectNumber   = new ProjectNumber(intProfile, dsn);
     oService         = new Services(intProfile, dsn);
     oUser            = new Users(intProfile, dsn);
     oDelegate        = new Delegates(intProfile, dsn);
     if (Request.QueryString["action"] != null && Request.QueryString["action"] != "")
     {
         panFinish.Visible = true;
     }
     else
     {
         panForm.Visible = true;
         if (Request.QueryString["rrid"] != null && Request.QueryString["rrid"] != "")
         {
             int     intResourceWorkflow = Int32.Parse(Request.QueryString["rrid"]);
             int     intResourceParent   = oResourceRequest.GetWorkflowParent(intResourceWorkflow);
             DataSet ds = oResourceRequest.Get(intResourceParent);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 int intUser    = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid"));
                 int intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                 int intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                 int intApp     = oRequestItem.GetItemApplication(intItem);
                 //if (intProfile == intUser || oService.IsManager(intService, intProfile) || oDelegate.Get(intUser, intProfile) > 0 || (oApplication.IsManager(intApp, intProfile) && oApplication.Get(intApp, "disable_manager") != "1") || (oUser.IsManager(intUser, intProfile, true) && oApplication.Get(intApp, "disable_manager") != "1"))
                 //{
                 int intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                 hdnRequestID.Value = intRequest.ToString();
                 int    intProject = oRequest.GetProjectNumber(intRequest);
                 string strPath    = "";
                 if (intItem == 0)
                 {
                     strPath = strPCWM;
                 }
                 else if (intItem == -1)
                 {
                     strPath = strTaskWM;
                 }
                 else
                 {
                     if (oApplication.Get(intApp, "tpm") != "1" && oProject.Get(intProject, "number") == "")
                     {
                         oProject.Update(intProject, oProjectNumber.New());
                     }
                     strPath = oService.Get(intService, "wm_path");
                 }
                 if (strPath != "")
                 {
                     oForm.Controls.Add((Control)LoadControl(strPath));
                 }
                 string strTitle = "Task";
                 if (intProject > 0)
                 {
                     strTitle = oProject.Get(intProject, "name");
                 }
                 Master.Page.Title = strTitle + " | " + oService.GetName(intService);
                 //}
                 //else
                 //    panDenied.Visible = true;
             }
             else
             {
                 panDenied.Visible = true;
             }
         }
     }
     btnFinish.Attributes.Add("onclick", "return CloseWindow();");
     btnClose.Attributes.Add("onclick", "return CloseWindow();");
 }
Exemplo n.º 29
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?');");
        }
        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);
                                }
                            }
                        }
                    }
                }
            }