protected void btnFavorite_Click(Object Sender, EventArgs e) { int intRequest = 0; if (intRequest == 0) { intRequest = oRequest.Add(-1, intProfile); oServiceRequest.Add(intRequest, 1, -2); } string strHidden = Request.Form[hdnService.UniqueID]; while (strHidden != "") { string strField = strHidden.Substring(0, strHidden.IndexOf("&")); strHidden = strHidden.Substring(strHidden.IndexOf("&") + 1); string strFlag = strField.Substring(strField.IndexOf("_") + 1); strField = strField.Substring(0, strField.IndexOf("_")); if (strFlag == "1") { oService.AddSelected(intRequest, Int32.Parse(strField), 1); } } oServiceRequest.Update(intRequest, -1); Response.Redirect(oPage.GetFullLink(intViewRequest) + "?rid=" + intRequest.ToString()); }
protected void btnSave_Click(Object Sender, EventArgs e) { oVariables = new Variables(intEnvironment); string strVirtualPath = ""; if (fileUpload.FileName != "" && fileUpload.PostedFile != null) { string strExtension = fileUpload.FileName; string strType = strExtension.Substring(0, 3); strExtension = strExtension.Substring(strExtension.LastIndexOf(".")); string strFile = DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Year.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + "_" + intProfile.ToString() + strExtension; strVirtualPath = oVariables.UploadsFolder() + strFile; string strPath = oVariables.UploadsFolder() + strFile; fileUpload.PostedFile.SaveAs(strPath); } intRequest = oRequest.AddTask(0, intProfile, txtDescription.Text, DateTime.Now, DateTime.Now); intItemID = oService.GetItemId(intService); int intResource = oServiceRequest.AddRequest(intRequest, intItemID, intService, 0, 0.00, 2, 2, dsnServiceEditor); oServiceRequest.Update(intRequest, txtTitle.Text); oResourceRequest.UpdateName(intResource, txtTitle.Text); oServiceRequest.Add(intRequest, 1, 1); oCustomized.AddIssue(intRequest, txtTitle.Text, txtDescription.Text, Int32.Parse(drpModules.SelectedValue), Int32.Parse(txtNumUsers.Text == "" ? "0" : txtNumUsers.Text), txtURL.Text, strVirtualPath, intProfile, 0); if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false) { oServiceRequest.NotifyTeamLead(intItemID, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0); } Response.Redirect(oPage.GetFullLinkRelated(intPage)); }
protected void btnNext_Click(Object Sender, EventArgs e) { int intRequest = Int32.Parse(Request.QueryString["rid"]); int intItem = Int32.Parse(lblItem.Text); int intNumber = Int32.Parse(lblNumber.Text); oServiceRequest.Update(intRequest, txtTitle.Text); oCustomized.AddThirdTierDistributed(intRequest, intItem, intNumber, Int32.Parse(radPriority.SelectedItem.Value), txtStatement.Text, double.Parse(txtHours.Text), DateTime.Parse(txtStart.Text), DateTime.Parse(txtEnd.Text)); oRequestItem.UpdateForm(intRequest, true); Response.Redirect(oPage.GetFullLink(intPage) + "?rid=" + intRequest.ToString()); }
protected void btnNext_Click(Object Sender, EventArgs e) { int intRequest = Int32.Parse(Request.QueryString["rid"]); int intItem = Int32.Parse(lblItem.Text); int intNumber = Int32.Parse(lblNumber.Text); oRequest.UpdateDescription(intRequest, txtStatement.Text); oServiceRequest.Update(intRequest, txtTitle.Text); oRequest.UpdateStartDate(intRequest, DateTime.Parse(txtStart.Text)); oRequest.UpdateEndDate(intRequest, DateTime.Parse(txtEnd.Text)); oRequestItem.UpdateForm(intRequest, true); Response.Redirect(oPage.GetFullLink(intPage) + "?rid=" + intRequest.ToString()); }
protected void btnNext_Click(Object Sender, EventArgs e) { int intRequest = Int32.Parse(Request.QueryString["rid"]); int intItem = Int32.Parse(lblItem.Text); int intNumber = Int32.Parse(lblNumber.Text); string _sql = ""; string _version = ""; int _dba = 0; string _cluster_group_new = ""; string _cluster_group_existing = ""; int _tsm = 0; string _networkname = ""; string _ipaddress = ""; string _newdriveletter = ""; string _newmountpoint = ""; string _increase = ""; string _filesystem = ""; string _client_amount = ""; if (ddlCluster.SelectedIndex == 1) { // CLUSTER = YES if (ddlClusterYesSQLGroup.SelectedIndex == 1) { // GROUP = NEW _cluster_group_new = ddlClusterYesSQLGroup.SelectedItem.Value; _tsm = (chkClusterYesGroupNewTSM.Checked ? 1 : 0); _networkname = (chkClusterYesGroupNewNetwork.Checked ? txtClusterYesGroupNewNetwork.Text : ""); _ipaddress = (chkClusterYesGroupNewIP.Checked ? txtClusterYesGroupNewIP.Text : ""); } else { _cluster_group_existing = txtClusterYesGroupExisting.Text; _increase = ddlClusterYesGroupExisting.SelectedItem.Value; _filesystem = txtClusterYesGroupExistingFileSystem.Text; } } else { // CLUSTER = NO _increase = ddlClusterNo.SelectedItem.Value; _filesystem = txtClusterNo.Text; } _client_amount = txtAdditional.Text; oServiceRequest.Update(intRequest, "Server Growth Request (" + txtServerName.Text + ")"); oCustomized.AddStorage3rd(intRequest, intItem, intNumber, txtServerName.Text, ddlOS.SelectedItem.Value, ddlMaintenance.SelectedItem.Value, ddlCurrent.SelectedItem.Value, ddlType.SelectedItem.Value, ddlDR.SelectedItem.Value, ddlPerformance.SelectedItem.Value, ddlChange.SelectedItem.Value, ddlCluster.SelectedItem.Value, _sql, _version, _dba, _cluster_group_new, _tsm, _networkname, _ipaddress, _cluster_group_existing, 0, 0, _newdriveletter, _newmountpoint, _increase, txtDescription.Text, 0, 0, 0, "", "", 0, "", "", 0.00, "", "", "", "", "", "", "", "", "", "", 0.00, 1, intProfile, DateTime.Parse(txtDate.Text), _filesystem, _client_amount); oCustomized.UpdateStorage3rdFlow1(intRequest, intItem, intNumber); oRequestItem.UpdateForm(intRequest, true); Response.Redirect(oPage.GetFullLink(intPage) + "?rid=" + intRequest.ToString()); }
protected void btnSave_Click(Object Sender, EventArgs e) { intRequest = oRequest.Add(0, intProfile); int intItemID = oService.GetItemId(intService); int intResource = oServiceRequest.AddRequest(intRequest, intItemID, intService, 0, 0.00, (int)EnhancementStatus.UnderReview, 1, dsnServiceEditor); oServiceRequest.Update(intRequest, txtTitle.Text); oResourceRequest.UpdateName(intResource, txtTitle.Text); oServiceRequest.Add(intRequest, 1, 1); intID = oEnhancement.Add(txtTitle.Text, txtDescription.Text, Int32.Parse(ddlUsers.SelectedItem.Value), txtURL.Text, fileUpload, intEnvironment, Int32.Parse(radRelease1.SelectedItem.Value), Int32.Parse(radRelease2.SelectedItem.Value), intProfile, intResource); if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false) { oServiceRequest.NotifyTeamLead(intItemID, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0); } oEnhancement.AddLog(intID, 0, "Submitted Original Enhancement", intProfile, ""); Response.Redirect(oPage.GetFullLinkRelated(intPage)); }
protected void InitiateAddStorageWorkOrder() { ServiceDetails oServiceDetail = new ServiceDetails(intProfile, dsn); int intRequest = Int32.Parse(hdnRequestId.Value); int intServiceId = 0; intServiceId = Int32.Parse(ConfigurationManager.AppSettings["SERVICEID_ASSET_SHARED_ENV_ADD_STORAGE"]); string strServerTitle = "Inventory Management - Shared Environment Add Storage"; int intItemID = oService.GetItemId(intServiceId); int intNumber = 1; double dblServiceHours = oServiceDetail.GetHours(intServiceId, 1); int intResource = oServiceRequest.AddRequest(intRequest, intItemID, intServiceId, 1, dblServiceHours, 2, intNumber, dsnServiceEditor); oServiceRequest.Update(intRequest, strServerTitle); oResourceRequest.UpdateName(intResource, strServerTitle); oServiceRequest.Add(intRequest, 1, 1); }
protected void btnUpdate_Click(Object Sender, EventArgs e) { oVariables = new Variables(intEnvironment); if (fileUpload.FileName != "" && fileUpload.PostedFile != null) { string strExtension = fileUpload.FileName; string strType = strExtension.Substring(0, 3); strExtension = strExtension.Substring(strExtension.LastIndexOf(".")); string strFile = DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Year.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + "_" + intProfile.ToString() + strExtension; string strVirtualPath = oVariables.UploadsFolder() + strFile; string strPath = oVariables.UploadsFolder() + strFile; fileUpload.PostedFile.SaveAs(strPath); lblPath.Text = strVirtualPath; } oCustomized.UpdateEnhancement(intRequest, txtTitle.Text, txtDescription.Text, Int32.Parse(drpModules.SelectedValue), Int32.Parse(txtNumUsers.Text), txtURL.Text, lblPath.Text, DateTime.Parse(txtStartDate.Text), DateTime.Parse(txtEndDate.Text)); oServiceRequest.Update(intRequest, txtTitle.Text); oRequest.UpdateDescription(intRequest, txtTitle.Text); ClientScript.RegisterClientScriptBlock(typeof(Page), "redirect", "window.top.navigate(window.top.location);", true); }
protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = "/admin/projects_pending.aspx"; Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30); if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "") { intProfile = Int32.Parse(Request.Cookies["adminid"].Value); } else { Response.Redirect("/admin/login.aspx"); } oProject = new Projects(intProfile, dsn); oProjectNumber = new ProjectNumber(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oRequestItem = new RequestItems(intProfile, dsn); oService = new Services(intProfile, dsn); oProjectPending = new ProjectsPending(intProfile, dsn, intEnvironment); oOrganization = new Organizations(intProfile, dsn); oDocument = new Documents(intProfile, dsn); oUser = new Users(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oServiceRequest = new ServiceRequests(intProfile, dsn); if (!IsPostBack) { if (Request.QueryString["rid"] != null && Request.QueryString["rid"] != "") { // Process Service Requests int intRequest = Int32.Parse(Request.QueryString["rid"]); DataSet dsForm = oRequestItem.GetForms(intRequest); foreach (DataRow drForm in dsForm.Tables[0].Rows) { if (drForm["done"].ToString() == "0") { int intItem = Int32.Parse(drForm["itemid"].ToString()); int intNumber = Int32.Parse(drForm["number"].ToString()); int intService = Int32.Parse(drForm["serviceid"].ToString()); string strPath = oService.Get(intService, "cp_path"); if (strPath.Trim() == "") { // For now, bypass oRequestItem.UpdateFormDone(intRequest, intItem, intNumber, 1); } else { Control oControl = (Control)LoadControl(strPath); PHcp.Controls.Add(oControl); } } } panPH.Visible = true; } else if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { DataSet ds = oProjectPending.Get(Int32.Parse(Request.QueryString["id"])); int intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString()); if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "") { int intProject = Int32.Parse(Request.QueryString["pid"]); if (intProject > 0) { // Process Design Builder DataSet dsForecast = oForecast.GetRequest(intRequest); if (dsForecast.Tables[0].Rows.Count > 0) { int intForecast = Int32.Parse(dsForecast.Tables[0].Rows[0]["id"].ToString()); DataSet dsDesigns = oForecast.GetAnswers(intForecast); OnDemandTasks oOnDemandTasks = new OnDemandTasks(0, dsn); ResourceRequest oResourceRequest = new ResourceRequest(0, dsn); foreach (DataRow drDesign in dsDesigns.Tables[0].Rows) { int intDesign = Int32.Parse(drDesign["id"].ToString()); int intDesignRequest = 0; if (Int32.TryParse(oForecast.GetAnswer(intDesign, "requestid"), out intDesignRequest) == true) { if (intDesignRequest > 0) { // Update the REQUESTID in CV_FORECAST_ANSWERS with the new project correlation oRequest.Update(intDesignRequest, intProject); } } if (oForecast.CanAutoProvision(intDesign) == false) { // Need to add a builder int intImplementorD = 0; DataSet dsResourceD = oResourceRequest.GetProjectItem(intProject, intImplementorDistributed); if (dsResourceD.Tables[0].Rows.Count > 0) { intImplementorD = Int32.Parse(dsResourceD.Tables[0].Rows[0]["userid"].ToString()); } int intImplementorM = 0; DataSet dsResourceM = oResourceRequest.GetProjectItem(intProject, intImplementorMidrange); if (dsResourceM.Tables[0].Rows.Count > 0) { intImplementorM = Int32.Parse(dsResourceM.Tables[0].Rows[0]["userid"].ToString()); } if (oForecast.GetPlatformDistributedForecast(intDesign, intWorkstationPlatform) == true) { if (intImplementorD > 0) { int intNextNumber = oResourceRequest.GetNumber(intRequest); int intResourceParent = oResourceRequest.Add(intRequest, -1, -1, intNextNumber, "Provisioning Task (Distributed)", 0, 6.00, 2, 1, 1, 1); int intResourceWorkflow = oResourceRequest.AddWorkflow(intResourceParent, 0, "Provisioning Task (Distributed)", intImplementorD, 0, 6.00, 2, 0); oOnDemandTasks.AddPending(intDesign, intResourceWorkflow); oResourceRequest.UpdateAssignedBy(intResourceParent, -999); } else { // Submit for assignment if (oServiceRequest.Get(intRequest, "requestid") == "") { oServiceRequest.Add(intRequest, 1, 1); } int intResource = oServiceRequest.AddRequest(intRequest, intImplementorDistributed, intImplementorDistributedService, 0, 0.00, 2, 1, dsnServiceEditor); if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false) { oServiceRequest.NotifyTeamLead(intImplementorDistributed, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0); } } } if (oForecast.GetPlatformMidrangeForecast(intDesign) == true) { if (intImplementorM > 0) { int intNextNumber = oResourceRequest.GetNumber(intRequest); int intResourceParent = oResourceRequest.Add(intRequest, -1, -1, intNextNumber, "Provisioning Task (Midrange)", 0, 6.00, 2, 1, 1, 1); int intResourceWorkflow = oResourceRequest.AddWorkflow(intResourceParent, 0, "Provisioning Task (Midrange)", intImplementorM, 0, 6.00, 2, 0); oOnDemandTasks.AddPending(intDesign, intResourceWorkflow); oResourceRequest.UpdateAssignedBy(intResourceParent, -999); } else { // Submit for assignment if (oServiceRequest.Get(intRequest, "requestid") == "") { oServiceRequest.Add(intRequest, 1, 1); } int intResource = oServiceRequest.AddRequest(intRequest, intImplementorMidrange, intImplementorMidrangeService, 0, 0.00, 2, 1, dsnServiceEditor); if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false) { oServiceRequest.NotifyTeamLead(intImplementorMidrange, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0); } } } } } } } oRequest.Update(intRequest, intProject); oDocument.Update(intRequest, intProject); oProjectPending.Approve(Int32.Parse(Request.QueryString["id"])); if (intProject == 0) { oServiceRequest.Update(intRequest, ds.Tables[0].Rows[0]["name"].ToString()); } Response.Redirect(Request.Path + "?rid=" + intRequest.ToString()); } else { if (Request.QueryString["reject"] != null) { panReject.Visible = true; } else { strProject = LoadProject(0, ds.Tables[0].Rows[0], intRequest, true); btnView.Attributes.Add("onclick", "return ShowServiceRequests('" + intRequest.ToString() + "');"); btnViewDesigns.Attributes.Add("onclick", "return ShowDesigns('" + intRequest.ToString() + "');"); if (Request.QueryString["c"] != null && Request.QueryString["c"] != "") { panCompare.Visible = true; string[] strProjects; char[] strSplit = { ' ' }; strProjects = Request.QueryString["c"].Split(strSplit); bool boolOther = false; for (int jj = 0; jj < strProjects.Length; jj++) { if (strProjects[jj].Trim() != "") { TableRow oRow = new TableRow(); TableCell oCell = new TableCell(); oCell.Text = strProject; oRow.Cells.Add(oCell); oCell = new TableCell(); HyperLink oCheck = new HyperLink(); oCheck.ImageUrl = "/images/bigCheck.gif"; oCheck.ToolTip = "Click to Assign"; oCheck.NavigateUrl = Request.Path + "?id=" + Request.QueryString["id"] + "&pid=" + strProjects[jj]; oCheck.Attributes.Add("onclick", "return confirm('Are you sure you want to assign this project?');"); oCell.Controls.Add(oCheck); oRow.Cells.Add(oCell); oCell = new TableCell(); oCell.Text = LoadProject(Int32.Parse(strProjects[jj]), null, 0, false); if (boolOther == true) { oRow.Attributes.Add("bgcolor", "#EFEFEF"); } boolOther = !boolOther; oRow.Cells.Add(oCell); tblCompare.Rows.Add(oRow); } } } else { panView.Visible = true; LoadList(); } } } } else { panAll.Visible = true; DataSet ds = oProjectPending.Gets(); rptView.DataSource = ds; rptView.DataBind(); } } btnCreateProject.Attributes.Add("onclick", "return confirm('Are you sure you want to create this PROJECT?');"); btnCreateTask.Attributes.Add("onclick", "return confirm('Are you sure you want to create this TASK?');"); btnCreateTask.Enabled = false; btnRejectConfirm.Attributes.Add("onclick", "return confirm('Are you sure you want to reject this project / task?');"); }
protected void btnNext_Click(Object Sender, EventArgs e) { int intRequest = Int32.Parse(Request.QueryString["rid"]); int intItem = Int32.Parse(lblItem.Text); int intNumber = Int32.Parse(lblNumber.Text); string _sql = ""; string _version = ""; int _dba = 0; string _cluster_group_new = ""; string _cluster_group_existing = ""; int _tsm = 0; string _networkname = ""; string _ipaddress = ""; string _newdriveletter = ""; string _newmountpoint = ""; string _increase = ""; if (ddlCluster.SelectedIndex == 1) { // CLUSTER = YES _sql = ddlClusterYesSQL.SelectedItem.Value; if (ddlClusterYesSQL.SelectedIndex == 1) { // SQL = YES _version = ddlClusterYesSQLYesVersion.SelectedItem.Value; _dba = Int32.Parse(Request.Form[hdnDBA.UniqueID]); _cluster_group_new = ddlClusterYesSQLGroup.SelectedItem.Value; _cluster_group_existing = txtClusterYesGroupExisting.Text; _tsm = (chkClusterYesGroupNewTSM.Checked ? 1 : 0); _networkname = (chkClusterYesGroupNewNetwork.Checked ? txtClusterYesGroupNewNetwork.Text : ""); _ipaddress = (chkClusterYesGroupNewIP.Checked ? txtClusterYesGroupNewIP.Text : ""); } else { // SQL = NO _newdriveletter = ddlClusterYesSQLNoType.SelectedItem.Value; _newmountpoint = txtClusterYesSQLNoMount.Text; _cluster_group_new = ddlClusterYesSQLGroup.SelectedItem.Value; _cluster_group_existing = txtClusterYesGroupExisting.Text; _tsm = (chkClusterYesGroupNewTSM.Checked ? 1 : 0); _networkname = (chkClusterYesGroupNewNetwork.Checked ? txtClusterYesGroupNewNetwork.Text : ""); _ipaddress = (chkClusterYesGroupNewIP.Checked ? txtClusterYesGroupNewIP.Text : ""); } } else { // CLUSTER = NO _sql = ddlClusterNoSQL.SelectedItem.Value; if (ddlClusterNoSQL.SelectedIndex == 1) { // SQL = YES _version = ddlClusterNoSQLYesVersion.SelectedItem.Value; _dba = Int32.Parse(Request.Form[hdnDBA.UniqueID]); } else { // SQL = NO _increase = ddlClusterNoSQLNo.SelectedItem.Value; } } oServiceRequest.Update(intRequest, "Server Growth Request (" + txtServerName.Text + ")"); oCustomized.AddStorage3rd(intRequest, intItem, intNumber, txtServerName.Text, ddlOS.SelectedItem.Value, ddlMaintenance.SelectedItem.Value, ddlCurrent.SelectedItem.Value, ddlType.SelectedItem.Value, ddlDR.SelectedItem.Value, ddlPerformance.SelectedItem.Value, ddlChange.SelectedItem.Value, ddlCluster.SelectedItem.Value, _sql, _version, _dba, _cluster_group_new, _tsm, _networkname, _ipaddress, _cluster_group_existing, chkSQLYes2005.Items[0].Selected ? 1 : 0, chkSQLYes2005.Items[1].Selected ? 1 : 0, _newdriveletter, _newmountpoint, _increase, txtDescription.Text, Int32.Parse(ddlClass.SelectedItem.Value), Int32.Parse(Request.Form[hdnEnvironment.UniqueID]), Int32.Parse(Request.Form[hdnLocation.UniqueID]), ddlFabric.SelectedItem.Value, ddlReplicated.SelectedItem.Value, (ddlHA.SelectedItem.Value == "Yes" ? 1 : 0), ddlType2.SelectedItem.Value, ddlExpand.SelectedItem.Value, double.Parse(txtAdditional.Text), Request.Form[hdnLUNs.UniqueID], txtWWW.Text, txtUID.Text, txtNode.Text, txtEnclosureName.Text, txtEnclosureSlot.Text, txtReplicatedServerName.Text, txtReplicatedWWW.Text, txtReplicatedEnclosureName.Text, txtReplicatedEnclosureSlot.Text, 0.00, 0, intProfile, DateTime.Parse(txtDate.Text), "", ""); oCustomized.UpdateStorage3rdFlow1(intRequest, intItem, intNumber); oCustomized.UpdateStorage3rdFlow2(intRequest, intItem, intNumber, intItem, intNumber); oRequestItem.UpdateForm(intRequest, true); Response.Redirect(oPage.GetFullLink(intPage) + "?rid=" + intRequest.ToString()); }