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?');"); }
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?');"); }
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();"); }
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?');"); }
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 + "');"); }
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?');"); }
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?');"); }
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 + "');"); }
protected void Page_Load(object sender, EventArgs e) { if (boolWelcome == true) { panWelcome.Visible = true; Users oUser = new Users(0, dsn); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); strUser = "******" + oUser.Get(intProfile, "fname") + " " + oUser.Get(intProfile, "lname"); strTime = DateTime.Now.ToLongDateString(); } if (boolBread == true) { panBread.Visible = true; string strDivider = " | "; intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oApplication = new Applications(intProfile, dsn); oPage = new Pages(intProfile, dsn); oAppPage = new AppPages(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 (intApplication > 0) // { ds = oApplication.Get(intApplication); if (ds.Tables[0].Rows.Count > 0) { strMenu += strDivider + "<a class=\"topnav\" href=\"/" + ds.Tables[0].Rows[0]["url"].ToString() + "/default.aspx\">" + ds.Tables[0].Rows[0]["name"].ToString() + "</a>"; } string strSubMenu = ""; while (intPage > 0) { string strTitle = oPage.Get(intPage, "menutitle"); strSubMenu = strDivider + "<a class=\"topnav\" " + oPage.GetHref(intPage) + "\" title=\"" + strTitle + "\">" + strTitle + "</a>" + strSubMenu; intPage = oPage.GetParent(intPage); } if (strSubMenu != "") { strMenu += strSubMenu; } // } } }
private void LoadDeliverables(int _applicationid) { string strDeliverable = oApplication.Get(_applicationid, "deliverables_doc"); if (strDeliverable != "") { hypDeliverable.Enabled = true; hypDeliverable.NavigateUrl = strDeliverable; } else { hypDeliverable.Enabled = false; } }
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?');"); }
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?');"); }
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?');"); }
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?');"); }
protected void Page_Load() { int intApplication = 0; string strApplication = "Welcome to ClearView"; oApplication = new Applications(0, dsn); if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } if (intApplication > 0) { strApplication = oApplication.Get(intApplication, "name"); } if (Request.QueryString["t"] != null) { strApplication = Request.QueryString["t"]; } Bitmap oBitmap = new Bitmap(Server.MapPath((boolUsePNC ? "/images/header.gif" : "/images/headerNCB.gif"))); oBitmap = ConvertToRGB(oBitmap); Graphics oGraphic = Graphics.FromImage(oBitmap); oGraphic.TextRenderingHint = TextRenderingHint.AntiAlias; SolidBrush oWaterBrush = new SolidBrush(ColorTranslator.FromHtml((boolUsePNC ? "#EEEEEE" : "#333333"))); Font oWaterFont = new Font("Arial Black", 11, FontStyle.Regular, GraphicsUnit.Point); Point oWaterPoint = new Point(15, 46); oGraphic.DrawString(strApplication, oWaterFont, oWaterBrush, oWaterPoint); SolidBrush oWhiteBrush = new SolidBrush(ColorTranslator.FromHtml((boolUsePNC ? "#446388" : "#FFFFFF"))); Font oBrushFont = new Font("Arial Black", 11, FontStyle.Regular, GraphicsUnit.Point); Point oBrushPoint = new Point(11, 42); oGraphic.DrawString(strApplication, oBrushFont, oWhiteBrush, oBrushPoint); // Cleanup oWaterBrush.Dispose(); oWaterFont.Dispose(); oWhiteBrush.Dispose(); oBrushFont.Dispose(); oGraphic.Dispose(); Response.ContentType = "image/jpeg"; oBitmap.Save(Response.OutputStream, ImageFormat.Jpeg); oBitmap.Dispose(); }
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?');"); }
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 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?');"); }
private void LoadServer(DataRow dr) { int intRequest = Int32.Parse(dr["requestid"].ToString()); int intItem = Int32.Parse(dr["itemid"].ToString()); int intNumber = Int32.Parse(dr["number"].ToString()); string strNameCurrent = dr["name_current"].ToString(); string strIPCurrent = dr["ip_current"].ToString(); string strAliasCurrent = dr["alias_current"].ToString(); string strNameNew = dr["name_new"].ToString(); string strIPNew = dr["ip_new"].ToString(); string strAliasNew = dr["alias_new"].ToString(); string strReason = dr["reason"].ToString(); txtSearchName.Text = strNameCurrent; txtSearchIP.Text = strIPCurrent; txtSearchAlias.Text = strAliasCurrent; if (strReason != "") { // Show Confirmation Page lblName.Text = strNameCurrent; lblIP.Text = strIPCurrent; lblAlias.Text = strAliasCurrent; panConfirm.Visible = true; strConfirm = oDNS.GetDNSBody(intRequest, intItem, intNumber, true, intEnvironment); btnNext.Attributes.Add("onclick", "return ValidateCheck('" + chkAgree.ClientID + "','Please check the box stating that you agree to the disclaimer notice')" + " && ProcessButton(this)" + ";"); btnDiscard.Attributes.Add("onclick", "return confirm('WARNING: Starting over will discard all the changes you have made.\\n\\nAre you sure you want to continue?') && ProcessButton(this);"); btnContinue.Visible = false; btnConfirm.Visible = false; } else { panSearch.Visible = true; btnNext.Visible = false; // Get Record from DNS System.Net.NetworkCredential oCredentials = new System.Net.NetworkCredential(oVariable.ADUser(), oVariable.ADPassword(), oVariable.Domain()); ClearViewWebServices oWebService = new ClearViewWebServices(); oWebService.Timeout = Int32.Parse(ConfigurationManager.AppSettings["WS_TIMEOUT"]); oWebService.Credentials = oCredentials; oWebService.Url = oVariable.WebServiceURL(); Settings oSetting = new Settings(0, dsn); bool boolDNS_QIP = oSetting.IsDNS_QIP(); bool boolDNS_Bluecat = oSetting.IsDNS_Bluecat(); // Get Values if (strNameCurrent != "") { if (boolDNS_QIP == true) { strIPCurrent = oWebService.SearchDNSforPNC("", strNameCurrent, false, true); if (strIPCurrent.StartsWith("***") == false) { strNameCurrent = oWebService.SearchDNSforPNC(strIPCurrent, "", false, true); strAliasCurrent = oWebService.SearchDNSforPNC(strIPCurrent, "", true, true); if (strAliasCurrent.StartsWith("***") == true) { strAliasCurrent = ""; } } else { strNameCurrent = ""; strIPCurrent = ""; } } if (boolDNS_Bluecat == true) { strIPCurrent = oWebService.SearchBluecatDNS("", strNameCurrent); if (strIPCurrent.StartsWith("***") == false) { strNameCurrent = oWebService.SearchBluecatDNS(strIPCurrent, ""); strAliasCurrent = ""; } else { strNameCurrent = ""; strIPCurrent = ""; } } } else if (strIPCurrent != "") { if (boolDNS_QIP == true) { strNameCurrent = oWebService.SearchDNSforPNC(strIPCurrent, "", false, true); if (strNameCurrent.StartsWith("***") == false) { strAliasCurrent = oWebService.SearchDNSforPNC(strIPCurrent, "", true, true); if (strAliasCurrent.StartsWith("***") == true) { strAliasCurrent = ""; } } else { strNameCurrent = ""; strIPCurrent = ""; } } if (boolDNS_Bluecat == true) { strNameCurrent = oWebService.SearchBluecatDNS(strIPCurrent, ""); if (strNameCurrent.StartsWith("***") == false) { strAliasCurrent = ""; } else { strNameCurrent = ""; strIPCurrent = ""; } } } else if (strAliasCurrent != "") { if (boolDNS_QIP == true) { strIPCurrent = oWebService.SearchDNSforPNC("", strAliasCurrent, true, true); if (strIPCurrent.StartsWith("***") == false) { strNameCurrent = oWebService.SearchDNSforPNC(strIPCurrent, "", false, true); strAliasCurrent = oWebService.SearchDNSforPNC(strIPCurrent, "", true, true); if (strAliasCurrent.StartsWith("***") == true) { strAliasCurrent = ""; } } else { strAliasCurrent = ""; strIPCurrent = ""; } } if (boolDNS_Bluecat == true) { strAliasCurrent = ""; strIPCurrent = ""; } } if (strNameCurrent.Contains(".") == true) { strDomain = strNameCurrent.Substring(strNameCurrent.IndexOf(".")); strNameCurrent = strNameCurrent.Substring(0, strNameCurrent.IndexOf(".")); } if (strNameCurrent != "" && strIPCurrent != "") { DataSet ds = oServer.GetDNS(strNameCurrent); if (ds.Tables[0].Rows.Count == 1) { bool boolPermit = false; int intServer = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString()); int intUser = (ds.Tables[0].Rows[0]["userid"].ToString() == "" ? 0 : Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())); int intOwner = (ds.Tables[0].Rows[0]["appcontact"].ToString() == "" ? 0 : Int32.Parse(ds.Tables[0].Rows[0]["appcontact"].ToString())); int intPrimary = (ds.Tables[0].Rows[0]["admin1"].ToString() == "" ? 0 : Int32.Parse(ds.Tables[0].Rows[0]["admin1"].ToString())); int intSecondary = (ds.Tables[0].Rows[0]["admin2"].ToString() == "" ? 0 : Int32.Parse(ds.Tables[0].Rows[0]["admin2"].ToString())); int intRequestor = (ds.Tables[0].Rows[0]["requestor"].ToString() == "" ? 0 : Int32.Parse(ds.Tables[0].Rows[0]["requestor"].ToString())); int intClass = (ds.Tables[0].Rows[0]["classid"].ToString() == "" ? 0 : Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString())); int intProd = (intClass > 0 ? (oClass.IsProd(intClass) ? 1 : 0) : -1); panShow.Visible = true; panAlias.Visible = boolDNS_QIP; lblName.Text = strNameCurrent; lblIP.Text = strIPCurrent; lblAlias.Text = strAliasCurrent; lblDomain.Text = strDomain; // Load Values txtName.Text = strNameCurrent; char[] strIPSplit = { '.' }; string[] strIP = strIPCurrent.Split(strIPSplit); txtIP1.Text = strIP[0]; txtIP2.Text = strIP[1]; txtIP3.Text = strIP[2]; txtIP4.Text = strIP[3]; char[] strAliasSplit = { ';' }; string[] strAlias = strAliasCurrent.Split(strAliasSplit); for (int ii = 0; ii < strAlias.Length; ii++) { if (strAlias[ii].Trim() != "") { string strAliasName = strAlias[ii].Trim(); while (strAliasName.Contains(strDomain) == true) { strAliasName = strAliasName.Replace(strDomain, ""); } lstAlias.Items.Add(new ListItem(strAliasName, strAliasName)); } } // Check Permission and either show read only, or permit edit if (intProfile == intOwner || intProfile == intPrimary || intProfile == intSecondary || intProfile == intRequestor) { boolPermit = true; } if (oApplication.Get(intApplication, "dns") == "1" || oUser.IsAdmin(intProfile) || intProfile == intUser) { boolPermit = true; } if (boolPermit == true) { btnContinue.Visible = false; txtSearchName.Enabled = false; txtSearchIP.Enabled = false; txtSearchAlias.Enabled = false; chkName.Attributes.Add("onclick", "CheckChange3('" + chkName.ClientID + "','" + chkIP.ClientID + "','" + chkAlias.ClientID + "','" + txtName.ClientID + "');"); chkIP.Attributes.Add("onclick", "CheckChange3('" + chkIP.ClientID + "','" + chkName.ClientID + "','" + chkAlias.ClientID + "','" + txtIP1.ClientID + "','" + txtIP2.ClientID + "','" + txtIP3.ClientID + "','" + txtIP4.ClientID + "');"); chkAlias.Attributes.Add("onclick", "CheckChange3('" + chkAlias.ClientID + "','" + chkName.ClientID + "','" + chkIP.ClientID + "','" + lstAlias.ClientID + "','" + btnAdd.ClientID + "','" + btnEdit.ClientID + "','" + btnRemove.ClientID + "','" + txtAlias.ClientID + "');"); btnAdd.Attributes.Add("onclick", "return AddDNS('" + lstAlias.ClientID + "','" + txtAlias.ClientID + "','" + hdnAlias.ClientID + "');"); btnEdit.Attributes.Add("onclick", "return EditDNS('" + lstAlias.ClientID + "','" + txtAlias.ClientID + "','" + hdnAlias.ClientID + "');"); btnRemove.Attributes.Add("onclick", "return RemoveDNS('" + lstAlias.ClientID + "','" + hdnAlias.ClientID + "');"); string strChange = ""; if (intProd != 0 || oServer.Get(intServer, "infrastructure") == "1") { panChange.Visible = true; strChange = " && ValidateTextLength('" + txtChange.ClientID + "', 'Please enter a valid change control number\\n\\n - Must start with either \"CHG\" or \"PTM\"\\n - Must be exactly 10 characters in length', 10, ['CHG','PTM'], ['CHG0000000','PTM0000000','CHG1111111','PTM1111111','CHG9999999','PTM9999999','CHGXXXXXXX','PTMXXXXXXX'])"; } btnConfirm.Attributes.Add("onclick", "return EnsureDNSCheck('" + chkName.ClientID + "','" + chkIP.ClientID + "','" + chkAlias.ClientID + "')" + " && (document.getElementById('" + chkName.ClientID + "').checked == false || (document.getElementById('" + chkName.ClientID + "').checked == true" + " && ValidateText('" + txtName.ClientID + "','Please enter a valid name')" + "))" + " && (document.getElementById('" + chkIP.ClientID + "').checked == false || (document.getElementById('" + chkIP.ClientID + "').checked == true" + " && ValidateNumberBetween('" + txtIP1.ClientID + "',1,255,'Please enter a valid IP Address')" + " && ValidateNumberBetween('" + txtIP2.ClientID + "',1,255,'Please enter a valid IP Address')" + " && ValidateNumberBetween('" + txtIP3.ClientID + "',1,255,'Please enter a valid IP Address')" + " && ValidateNumberBetween('" + txtIP4.ClientID + "',1,255,'Please enter a valid IP Address')" + "))" + strChange + " && ValidateText('" + txtReason.ClientID + "','Please enter a reason')" + " && ProcessButton(this)" + ";"); } else { btnConfirm.Visible = false; panAccess.Visible = true; chkName.Enabled = false; chkIP.Enabled = false; chkAlias.Enabled = false; btnAdd.Enabled = false; btnEdit.Enabled = false; btnRemove.Enabled = false; if (intUser > 0) { strContacts += "<tr><td>Device Owner:</td><td>" + oUser.GetFullName(intUser) + " (" + oUser.GetName(intUser) + ")" + "</td></tr>"; } if (intOwner > 0) { strContacts += "<tr><td>Departmental Manager:</td><td>" + oUser.GetFullName(intOwner) + " (" + oUser.GetName(intOwner) + ")" + "</td></tr>"; } if (intPrimary > 0) { strContacts += "<tr><td>Application Technical Lead:</td><td>" + oUser.GetFullName(intPrimary) + " (" + oUser.GetName(intPrimary) + ")" + "</td></tr>"; } if (intSecondary > 0) { strContacts += "<tr><td>Administrative Contact:</td><td>" + oUser.GetFullName(intSecondary) + " (" + oUser.GetName(intSecondary) + ")" + "</td></tr>"; } if (intRequestor > 0) { strContacts += "<tr><td>Design Initiated By:</td><td>" + oUser.GetFullName(intRequestor) + " (" + oUser.GetName(intRequestor) + ")" + "</td></tr>"; } DataSet dsDecoms = oApplication.GetDecoms(); if (dsDecoms.Tables[0].Rows.Count > 0) { strContacts += "<tr><td colspan=\"2\">Alternatively, you can contact a resource from one of the following departments:</td></tr>"; foreach (DataRow drDecom in dsDecoms.Tables[0].Rows) { strContacts += "<tr><td></td><td>" + drDecom["name"].ToString() + "</td></tr>"; } } } } else { btnReset.Enabled = false; btnConfirm.Visible = false; panExist.Visible = true; lblExist.Text = "This device does not exist in the database. Please try again..."; } } else { btnReset.Enabled = false; btnConfirm.Visible = false; panExist.Visible = true; lblExist.Text = "This device does not exist in DNS. Please try again..."; } } }
protected void Page_Load(object sender, EventArgs e) { Control oControl; Page.Title = strTitle; if (Request.QueryString["down"] != null) { oControl = (Control)LoadControl("/controls/sys/sys_down.ascx"); PH3.Controls.Add(oControl); } else { oControl = (Control)LoadControl("/controls/sys/sys_will_down.ascx"); PHDown.Controls.Add(oControl); oControl = (Control)LoadControl("/controls/sys/sys_certificate.ascx"); PHDown.Controls.Add(oControl); if (Request.Cookies["profileid"] == null || Request.Cookies["profileid"].Value == "") { Response.Cookies["userloginreferrer"].Value = Request.Url.PathAndQuery; oControl = (Control)LoadControl("/controls/sys/sys_login.ascx"); PH3.Controls.Add(oControl); } else { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oUser = new Users(intProfile, dsn); if (intProfile > 0) { lblName.Text = "<b>Welcome,</b> " + oUser.GetFullName(intProfile) + " (" + oUser.GetName(intProfile).ToUpper() + ")"; } oPage = new Pages(intProfile, dsn); oApplication = new Applications(intProfile, dsn); oPageControl = new PageControls(intProfile, dsn); oAppPage = new AppPages(intProfile, dsn); oDesigner = new Designer(intProfile, dsn); oServiceRequest = new ServiceRequests(intProfile, dsn); DataSet dsReturned = oServiceRequest.GetReturned(intProfile); if (dsReturned.Tables[0].Rows.Count > 0) { oControl = (Control)LoadControl("/controls/sys/sys_returned.ascx"); PH3.Controls.Add(oControl); } oControl = (Control)LoadControl("/controls/sys/sys_topnav.ascx"); PH1.Controls.Add(oControl); int intApplication = 0; int intPage = 0; if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "") { intApplication = Int32.Parse(Request.QueryString["applicationid"]); } if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "") { intPage = Int32.Parse(Request.QueryString["pageid"]); } if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } string strVariables = ""; foreach (string strName in Request.QueryString) { if (strName != "pageid" && strName != "apppageid") { strVariables += (strVariables == "" ? "?" : "&") + strName + "=" + Request.QueryString[strName]; } } if (intPage > 0) { strPage = oPage.GetFullLink(intPage).Substring(1) + strVariables; } if (intApplication > 0 || intPage > 0) { if (intApplication > 0) { ds = oApplication.Get(intApplication); if (ds.Tables[0].Rows.Count > 0) { this.Page.Title = "ClearView | " + ds.Tables[0].Rows[0]["name"].ToString(); } } if (intPage > 0) { this.Page.Title = "ClearView | " + oPage.Get(intPage, "browsertitle"); // Load Page Controls ds = oPageControl.GetPage(intPage, 1); if (ds.Tables[0].Rows.Count == 0) { oControl = (Control)LoadControl("/controls/sys/sys_pages.ascx"); PH3.Controls.Add(oControl); } else { ContentPlaceHolder oPlaceHolder; oPlaceHolder = (ContentPlaceHolder)Master.FindControl("AllContent"); foreach (DataRow dr in ds.Tables[0].Rows) { Control oTempControl = oPlaceHolder.FindControl(dr["placeholder"].ToString()); if (oTempControl != null) { oControl = LoadControl(Request.ApplicationPath + dr["path"].ToString()); oTempControl.Controls.Add(oControl); } } } } else { // Load User's Home Page Controls oControl = (Control)LoadControl("/controls/sys/sys_personal.ascx"); PH3.Controls.Add(oControl); //oControl = (Control)LoadControl("/controls/sys/sys_new.ascx"); oControl = (Control)LoadControl("/controls/sys/sys_whatsnew.ascx"); PH3.Controls.Add(oControl); ds = oDesigner.Get(intProfile, 1); foreach (DataRow dr in ds.Tables[0].Rows) { oControl = (Control)LoadControl(dr["path"].ToString()); PH3.Controls.Add(oControl); } } } else { // Load Available Applications oControl = (Control)LoadControl("/controls/sys/sys_application.ascx"); PH3.Controls.Add(oControl); } } } oControl = (Control)LoadControl("/controls/sys/sys_rotator_header.ascx"); PH4.Controls.Add(oControl); }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oPage = new Pages(intProfile, dsn); oServiceDetail = new ServiceDetails(intProfile, dsn); oService = new Services(intProfile, dsn); oApplication = new Applications(intProfile, dsn); oRequestItem = new RequestItems(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["aid"] != null && Request.QueryString["aid"] != "" && Request.QueryString["sid"] != null && Request.QueryString["sid"] != "") { LoadSearch(Int32.Parse(Request.QueryString["aid"]), Request.QueryString["sid"]); } else { panSearch.Visible = true; lblTitle.Text = "Search"; if (Request.QueryString["aid"] != null && Request.QueryString["aid"] != "") { int _applicationid = Int32.Parse(Request.QueryString["aid"]); if (Request.QueryString["iid"] != null && Request.QueryString["iid"] != "") { int _itemid = Int32.Parse(Request.QueryString["iid"]); LoadDepartments(); ddlDepartments.SelectedValue = _applicationid.ToString(); LoadGroups(_applicationid); LoadDeliverables(_applicationid); ddlGroups.SelectedValue = _itemid.ToString(); panCategory.Visible = true; LoadServices(_applicationid, _itemid); } else { LoadDepartments(); LoadDeliverables(_applicationid); ddlDepartments.SelectedValue = _applicationid.ToString(); if (oApplication.Get(_applicationid, "service_search_items") == "1") { LoadSubServices(_applicationid); lstServices.Enabled = false; btnSearch.Enabled = false; lstServices.Items.Insert(0, new ListItem("Please select a category", "0")); } else { LoadServices(_applicationid, 0); } } } else { LoadDepartments(); lstServices.Enabled = false; btnSearch.Enabled = false; hypDeliverable.Enabled = false; lstServices.Items.Insert(0, new ListItem("Please select a department", "0")); } } hypClear.NavigateUrl = oPage.GetFullLink(intPage); }
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?');"); }
protected void btnSubmit_Click(Object Sender, EventArgs e) { int intResourceParent = Int32.Parse(lblResourceParent.Text); ds = oResourceRequest.Get(intResourceParent); if (ds.Tables[0].Rows.Count > 0) { int intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString()); int intItem = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString()); int intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString()); int intNumber = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString()); string strCVT = "CVT" + intRequest.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString(); string strService = oService.GetName(intService); if (intService == 0) { strService = oRequestItem.GetItemName(intItem); } int intApp = oRequestItem.GetItemApplication(intItem); int intProject = Int32.Parse(oRequest.Get(intRequest, "projectid")); Projects oProject = new Projects(intProfile, dsn); ProjectsPending oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment); Functions oFunction = new Functions(intProfile, dsn, intEnvironment); Variables oVariable = new Variables(intEnvironment); RequestFields oRequestField = new RequestFields(intProfile, dsn); int intRequester = Int32.Parse(oRequest.Get(intRequest, "userid")); int intPC = 0; int intIE = 0; if (intProject > 0) { if (oProject.Get(intProject, "lead") != "") { intPC = Int32.Parse(oProject.Get(intProject, "lead")); } if (oProject.Get(intProject, "engineer") != "") { intIE = Int32.Parse(oProject.Get(intProject, "engineer")); } } else { try { intPC = Int32.Parse(oProjectsPending.GetRequest(intRequest, "lead")); intIE = Int32.Parse(oProjectsPending.GetRequest(intRequest, "engineer")); } catch { } } string strCC = ""; if (intPC > 0) { strCC += oUser.GetName(intPC) + ";"; } if (intIE > 0) { strCC += oUser.GetName(intIE) + ";"; } if (radReject.Checked == true) { string strComments = ""; if (txtComments.Text.Trim() != "") { strComments = "<p>The following comments were added:<br/>" + txtComments.Text + "</p>"; } string strDefault = oUser.GetApplicationUrl(intRequester, intAssignPage); strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT,EMAILGRP_REQUEST_STATUS"); if (strDefault == "" || oApplication.Get(intApp, "tpm") != "1") { oFunction.SendEmail("Request REJECTED: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request REJECTED: " + strService, "<p><b>The following request has been rejected by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetSummary(intResourceParent, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>" + strComments, true, false); } else { oFunction.SendEmail("Request REJECTED: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request REJECTED: " + strService, "<p><b>The following request has been rejected by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetSummary(intResourceParent, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>" + strComments + "<p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intAssignPage) + "?rrid=" + intResourceParent.ToString() + "\" target=\"_blank\">Click here to assign a new project manager to your request.</a></p>", true, false); } oResourceRequest.UpdateAccepted(intResourceParent, -1); oResourceRequest.UpdateReason(intResourceParent, txtComments.Text); } else if (radHold.Checked == true) { oResourceRequest.UpdateStatusOverall(intResourceParent, 5); oResourceRequest.UpdateReason(intResourceParent, txtHold.Text); } else { if (oApplication.Get(intApp, "tpm") != "1" && oProject.Get(intProject, "number") == "") { oProject.Update(intProject, oProjectNumber.New()); } oProject.Update(intProject, 2); bool boolSolo = (oResourceRequest.Get(intResourceParent, "solo") == "1"); int intAssigned = 0; bool boolRejected = (oResourceRequest.Get(intResourceParent, "accepted") == "-1"); ProjectRequest oProjectRequest = new ProjectRequest(intProfile, dsn); string strNotify = ""; string strSpacerRow = "<tr><td colspan=\"3\"><img src=\"" + oVariable.ImageURL() + "/images/spacer.gif\" border=\"0\" width=\"1\" height=\"7\" /></td></tr>"; if (boolRejected == true) { oResourceRequest.UpdateRejected(intResourceParent, 1); intAssigned = Int32.Parse(Request.Form[hdnManager.UniqueID]); int intResourceWorkflow = oResourceRequest.AddWorkflow(intResourceParent, 0, oResourceRequest.Get(intResourceParent, "name"), intAssigned, Int32.Parse(txtQuantity.Text), double.Parse(txtHours.Text), 2, 0); oLog.AddEvent(intRequest.ToString(), strCVT, "Request assigned by " + oUser.GetFullNameWithLanID(intProfile) + " to " + oUser.GetFullNameWithLanID(intAssigned), LoggingType.Debug); string strDefault = oUser.GetApplicationUrl(intAssigned, intViewPage); if (boolSolo == false) { strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT"); // ADD PM if (strDefault == "") { oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p>", true, false); } else { if (intProject > 0) { oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } else { oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } } string strExecutive = oProject.Get(intProject, "executive"); string strWorking = oProject.Get(intProject, "working"); string strActivity = "<tr><td><b>Resource:</b></td><td> </td><td>" + oUser.GetFullName(intAssigned) + "</td></tr>"; strActivity += strSpacerRow; strActivity += "<tr><td><b>Service:</b></td><td> </td><td>Project Coordinator</td></tr>"; strActivity = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>"; string strDeliverable = oApplication.Get(intApp, "deliverables_doc"); if (strDeliverable.Trim() != "") { strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>"; } if (oService.Get(intService, "notify_client") != "0") { strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT"); oFunction.SendEmail("Request Assignment", oUser.GetName(intRequester), strExecutive + ";" + strWorking + ";" + strCC, strEMailIdsBCC, "Request Assignment", "<p><b>A resource has been assigned to the following project...</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p>" + strActivity + "</p>" + strDeliverable + strNotify, true, false); } } else { strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_DEVELOPER_ERROR"); oFunction.SendEmail("ERROR: Request Assignment", strEMailIdsBCC, "", "", "ERROR: Request Assignment", "<p><b>A REJECTED resource request with a SOLO status of 1 has been assigned to " + oUser.GetName(intAssigned) + "...</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p>", true, false); } } else { oResourceRequest.UpdateAccepted(intResourceParent, 1); if (boolSolo == true) { string strResources = ""; DataSet dsAssigned = oResourceRequest.GetWorkflowsAssign(intResourceParent); foreach (DataRow drAssigned in dsAssigned.Tables[0].Rows) { intAssigned = Int32.Parse(drAssigned["userid"].ToString()); int intQuantity = Int32.Parse(drAssigned["devices"].ToString()); double dblHours = double.Parse(drAssigned["allocated"].ToString()); int intResourceWorkflow = oResourceRequest.AddWorkflow(intResourceParent, 0, oResourceRequest.Get(intResourceParent, "name"), intAssigned, intQuantity, dblHours, 2, 0); oLog.AddEvent(intRequest.ToString(), strCVT, "Request assigned by " + oUser.GetFullNameWithLanID(intProfile) + " to " + oUser.GetFullNameWithLanID(intAssigned), LoggingType.Debug); oResourceRequest.UpdateWorkflowStatus(intResourceWorkflow, 2, true); if (intItem != intImplementorDistributed && intItem != intImplementorMidrange) { //if (oProject.Get(intProject, "number").StartsWith("CV") == false) // strNotify = "<p><span style=\"color:#0000FF\"><b>PROJECT COORDINATOR:</b> Please allocate the hours listed above for each resource in Clarity.</span></p>"; string strDefault = oUser.GetApplicationUrl(intAssigned, intViewPage); strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT"); if (strDefault == "") { oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>", true, false); } else { if (intProject > 0) { oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } else { oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } } if (strResources != "") { strResources += ", "; } strResources += oUser.GetFullName(intAssigned); } } string strActivity = "<tr><td><b>Resource(s):</b></td><td> </td><td>" + strResources + "</td></tr>"; strActivity += strSpacerRow; strActivity += "<tr><td><b>Service:</b></td><td> </td><td>" + strService + "</td></tr>"; strActivity = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>"; string strDeliverable = oApplication.Get(intApp, "deliverables_doc"); strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT"); if (strDeliverable.Trim() != "") { strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>"; } if (oService.Get(intService, "notify_client") != "0") { oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intRequester), strCC, strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned...</b><p><p>" + oResourceRequest.GetSummary(intResourceParent, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p>" + strActivity + "</p>" + strDeliverable + strNotify, true, false); } } else { strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_DEVELOPER_ERROR"); oFunction.SendEmail("ERROR: Request Assignment", strEMailIdsBCC, "", "", "ERROR: Request Assignment", "<p><b>An ACCEPTED resource request with a SOLO status of 0 has been assigned... RRID = " + intResourceParent.ToString() + "</b></p>", true, false); } } oResourceRequest.UpdateStatusOverall(intResourceParent, 2); oResourceRequest.UpdateAssignedBy(intResourceParent, intProfile); } } Response.Redirect(oPage.GetFullLink(intPage) + "?action=finish"); }
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); oLocation = new Locations(intProfile, dsn); oClass = new Classes(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oType = new Types(intProfile, dsn); oModel = new Models(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oOperatingSystems = new OperatingSystems(intProfile, dsn); oVirtualHDD = new VirtualHDD(intProfile, dsn); oVirtualRam = new VirtualRam(intProfile, dsn); oVirtualCPU = new VirtualCPU(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["denied"] != null) { boolReqDenied = true; } if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null) { if (!IsPostBack) { LoadLists(); } panNavigation.Visible = true; 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 != "") { btnDeliverable.Visible = true; btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');"); } if (Request.QueryString["qty"] != null && Request.QueryString["qty"] != "") { if (Request.QueryString["qty"] == intMaxWorkstationsPerDay.ToString()) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "qty", "<script type=\"text/javascript\">alert('NOTE: You can request up to " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day.\\n\\nCurrently, you have requested " + Request.QueryString["qty"] + " virtual workstations and cannot be allocated additional hardware until tomorrow.\\n\\nIf your initiative requires more than " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day, you must use design builder.\\nPlease contact your technical lead or ClearView administrator for additional information.');<" + "/" + "script>"); } else if (Request.QueryString["qty"] == "0") { int intDiff = intMaxWorkstationsPerDay - Int32.Parse(Request.QueryString["qty"]); Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "qty", "<script type=\"text/javascript\">alert('NOTE: You can request up to " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day.\\n\\nCurrently, you have requested " + Request.QueryString["qty"] + " virtual workstations. Please enter a quantity of " + intDiff.ToString() + " or less to continue.\\n\\nIf your initiative requires more than " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day, you must use design builder.\\nPlease contact your technical lead or ClearView administrator for additional information.');<" + "/" + "script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "qty", "<script type=\"text/javascript\">alert('NOTE: You can request up to " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day.\\n\\nPlease enter a quantity of " + intMaxWorkstationsPerDay.ToString() + " or less to continue.\\n\\nIf your initiative requires more than " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day, you must use design builder.\\nPlease contact your technical lead or ClearView administrator for additional information.');<" + "/" + "script>"); } } else if (Request.QueryString["aid"] != null && Request.QueryString["aid"] != "") { intAnswer = Int32.Parse(Request.QueryString["aid"]); if (!IsPostBack) { DataSet dsAnswer = oForecast.GetAnswer(intAnswer); if (dsAnswer.Tables[0].Rows.Count > 0) { txtName.Text = dsAnswer.Tables[0].Rows[0]["name"].ToString(); ddlLocation.SelectedValue = dsAnswer.Tables[0].Rows[0]["addressid"].ToString(); ddlClass.SelectedValue = dsAnswer.Tables[0].Rows[0]["classid"].ToString(); txtQuantity.Text = dsAnswer.Tables[0].Rows[0]["quantity"].ToString(); dsAnswer = oForecast.GetWorkstation(intAnswer); if (dsAnswer.Tables[0].Rows.Count > 0) { ddlOS.SelectedValue = dsAnswer.Tables[0].Rows[0]["osid"].ToString(); ChangeOS(); chkDR.Checked = (dsAnswer.Tables[0].Rows[0]["recovery"].ToString() == "1"); radEmployee.SelectedValue = dsAnswer.Tables[0].Rows[0]["internal"].ToString(); ddlRam.SelectedValue = dsAnswer.Tables[0].Rows[0]["ramid"].ToString(); ddlHardDrive.SelectedValue = dsAnswer.Tables[0].Rows[0]["hddid"].ToString(); ddlCPU.SelectedValue = dsAnswer.Tables[0].Rows[0]["cpuid"].ToString(); } } } if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "") { panUpdate.Visible = true; panNavigation.Visible = false; if (boolReqDenied) { int intRequest = Int32.Parse(Request.QueryString["rid"]); int intNumber = Int32.Parse(lblNumber.Text); DataSet dsSelected2 = oService.GetSelected(intRequest, intService, intNumber); for (int ii = intNumber; ii > 0 && dsSelected2.Tables[0].Rows.Count == 0; ii--) { dsSelected2 = oService.GetSelected(intRequest, intService, ii - 1); } if (dsSelected2.Tables[0].Rows.Count > 0) { if (Int32.Parse(dsSelected2.Tables[0].Rows[0]["approved"].ToString()) < 0) { // Rejected lblReqDenyCommentValue.Text = oFunction.FormatText(dsSelected2.Tables[0].Rows[0]["reason"].ToString()); pnlReqDenied.Visible = true; } } } } } else { string strFormID = ""; if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "") { strFormID = "&formid=" + Request.QueryString["formid"]; } string strNumID = ""; if (Request.QueryString["num"] != null && Request.QueryString["num"] != "") { strNumID = "&num=" + Request.QueryString["num"]; } string strDenied = ""; if (Request.QueryString["denied"] != null && Request.QueryString["denied"] != "") { strDenied = "&denied=" + Request.QueryString["denied"]; } DataSet dsService = oForecast.GetAnswerService(Int32.Parse(Request.QueryString["rid"])); if (dsService.Tables[0].Rows.Count > 0) { Response.Redirect(oPage.GetFullLink(intPage) + "?rid=" + Request.QueryString["rid"] + strFormID + strNumID + strDenied + "&aid=" + dsService.Tables[0].Rows[0]["id"].ToString()); } } btnNext.Attributes.Add("onclick", "return ValidateDropDown('" + ddlClass.ClientID + "','Please select a class')" + " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter a valid quantity')" + " && ValidateDropDown('" + ddlOS.ClientID + "','Please select an Operating System')" + " && ValidateDropDown('" + ddlRam.ClientID + "','Please select a RAM')" + " && ValidateDropDown('" + ddlCPU.ClientID + "','Please select a CPU')" + " && ValidateDropDown('" + ddlHardDrive.ClientID + "','Please select a hard drive')" + ";"); } btnCancelR.Attributes.Add("onclick", "return confirm('Are you sure you want to cancel this service request?');"); ddlOS.Attributes.Add("onchange", "LoadWait();"); }
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 + "');"); }
public static Boolean SendEmail(MailMessage Message) { Application App = Applications.Get(AppId); Message.From = App.MailServer.SMTPFromAddress != String.Empty ? new MailAddress(App.MailServer.SMTPFromAddress, "MugsyClicks Web Site") : Message.ReplyToList[0]; SmtpClient client = new SmtpClient(); client.Host = App.MailServer.SMTPServer; if (App.MailServer.SMTPUsername != String.Empty && App.MailServer.SMTPPassword != String.Empty) { client.Credentials = new NetworkCredential(App.MailServer.SMTPUsername, App.MailServer.SMTPPassword); } client.Port = App.MailServer.SMTPPort; client.EnableSsl = App.MailServer.SMTPEnableSSL; try { client.Send(Message); } catch (Exception error) { // sofmen change 05/24/2013 : Pronob Mukharjee if (error.Message == "The operation has timed out.") { // bypassing timeout isse as email will be sent successfully in background return(true); } /* * if there is an error sending through the provider and the provider is not localhost * then try to send through smtp settings in the web.config */ if (App.MailServer.SMTPServer != "localhost") { client = new SmtpClient(); client.EnableSsl = Convert.ToBoolean(ConfigurationManager.AppSettings["UseSSL"]); try { client.Send(Message); } catch (Exception error2) { Debug.SendDebugEmail(App.ApplicationId, "Error Sending Email using NPCommerce.Application and web.config settings", "NPCommerce.Application Error Message:<br />" + error.Message + "<br /><br /><br />Web.Config Error Message:" + error2.Message); } finally { Debug.SendDebugEmail(App.ApplicationId, "Error Sending Email using NPCommerce.Application", "Error Message:<br />" + error.Message); } } return(false); } return(true); }
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();"); }
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> </td><td>" + oUser.GetFullName(intAssigned) + "</td></tr>"; strActivity += strSpacerRow; strActivity += "<tr><td><b>Service:</b></td><td> </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> </td><td>" + oUser.GetFullName(intAssigned) + "</td></tr>"; strActivity += strSpacerRow; strActivity += "<tr><td><b>Service:</b></td><td> </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); } } } } } }
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();"); }