protected void btnCreateProject_Click(Object Sender, EventArgs e) { DataSet ds = oProjectPending.Get(Int32.Parse(Request.QueryString["id"])); string number = ds.Tables[0].Rows[0]["number"].ToString(); if (String.IsNullOrEmpty(number)) { number = oProjectNumber.New(); } int intProject = oProject.Add(ds.Tables[0].Rows[0]["name"].ToString(), ds.Tables[0].Rows[0]["bd"].ToString(), number, Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString()), Int32.Parse(ds.Tables[0].Rows[0]["organization"].ToString()), Int32.Parse(ds.Tables[0].Rows[0]["segmentid"].ToString()), 1); oProject.Update(intProject, Int32.Parse(ds.Tables[0].Rows[0]["lead"].ToString()), Int32.Parse(ds.Tables[0].Rows[0]["executive"].ToString()), Int32.Parse(ds.Tables[0].Rows[0]["working"].ToString()), Int32.Parse(ds.Tables[0].Rows[0]["technical"].ToString()), Int32.Parse(ds.Tables[0].Rows[0]["engineer"].ToString()), Int32.Parse(ds.Tables[0].Rows[0]["other"].ToString())); Response.Redirect(Request.Path + "?id=" + Request.QueryString["id"] + "&pid=" + intProject.ToString()); }
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 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) { 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();"); }
protected int Save() { int intReturn = 1; oResourceRequest.UpdateName(intResource, txtName.Text); double dblAllocated = 0.00; if (panDynamic.Visible == false) { dblAllocated = double.Parse(txtAllocated.Text); } else { double dblQuantity = double.Parse(txtDevices.Text); dblAllocated = oServiceDetail.GetHours(Int32.Parse(txtAllocated.ToolTip), dblQuantity); } oResourceRequest.UpdateDevices(intResource, Int32.Parse(txtDevices.Text), dblAllocated); oResourceRequest.UpdateAccepted(intResource, Int32.Parse(ddlAccepted.SelectedItem.Value)); oResourceRequest.UpdateStatusOverall(intResource, Int32.Parse(ddlStatus.SelectedItem.Value)); oResourceRequest.UpdateReason(intResource, txtReason.Text); if (Request.Form[hdnAssignedBy.UniqueID] != "" && Request.Form[hdnAssignedBy.UniqueID] != "0") { oResourceRequest.UpdateAssignedBy(intResource, Int32.Parse(Request.Form[hdnAssignedBy.UniqueID])); } if (trAdmin.Visible == true) { int intUser = 0; if (Int32.TryParse(Request.Form[hdnUser.UniqueID], out intUser) == true) { // Assign resource DataSet ds = oResourceRequest.Get(intResource); if (ds.Tables[0].Rows.Count > 0) { int intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString()); int intItem = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString()); int intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString()); int intNumber = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString()); string strCVT = "CVT" + intRequest.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString(); string strService = oService.GetName(intService); if (intService == 0) { strService = oRequestItem.GetItemName(intItem); } int intApp = oRequestItem.GetItemApplication(intItem); int intProject = Int32.Parse(oRequest.Get(intRequest, "projectid")); Variables oVariable = new Variables(intEnvironment); DataSet dsWorkflow = oResourceRequest.GetWorkflowsParent(intResource); if (dsWorkflow.Tables[0].Rows.Count == 0) { // New Assignment Projects oProject = new Projects(intProfile, dsn); ProjectsPending oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment); int intRequester = Int32.Parse(oRequest.Get(intRequest, "userid")); int intPC = 0; int intIE = 0; if (intProject > 0) { if (oProject.Get(intProject, "lead") != "") { intPC = Int32.Parse(oProject.Get(intProject, "lead")); } if (oProject.Get(intProject, "engineer") != "") { intIE = Int32.Parse(oProject.Get(intProject, "engineer")); } } else { try { intPC = Int32.Parse(oProjectsPending.GetRequest(intRequest, "lead")); intIE = Int32.Parse(oProjectsPending.GetRequest(intRequest, "engineer")); } catch { } } string strCC = ""; if (intPC > 0) { strCC += oUser.GetName(intPC) + ";"; } if (intIE > 0) { strCC += oUser.GetName(intIE) + ";"; } bool boolSolo = (oResourceRequest.Get(intResource, "solo") == "1"); int intAssigned = 0; bool boolRejected = (oResourceRequest.Get(intResource, "accepted") == "-1"); intAssigned = intUser; oResourceRequest.UpdateAccepted(intResource, 1); oProject.Update(intProject, 2); int intResourceWorkflow = oResourceRequest.AddWorkflow(intResource, 0, oResourceRequest.Get(intResource, "name"), intAssigned, 1, 1.00, 2, 0); oLog.AddEvent(intRequest.ToString(), strCVT, "Request assigned by " + oUser.GetFullNameWithLanID(intProfile) + " (ADMIN) to " + oUser.GetFullNameWithLanID(intAssigned), LoggingType.Debug); oResourceRequest.UpdateAssignedBy(intResource, intProfile); ProjectRequest oProjectRequest = new ProjectRequest(intProfile, dsn); string strDefault = oUser.GetApplicationUrl(intAssigned, intViewPage); string strNotify = ""; string strSpacerRow = "<tr><td colspan=\"3\"><img src=\"" + oVariable.ImageURL() + "/images/spacer.gif\" border=\"0\" width=\"1\" height=\"7\" /></td></tr>"; oResourceRequest.UpdateDevices(intResource, 1, 1.00); if (boolSolo == true) { oResourceRequest.UpdateStatusOverall(intResource, 2); if (oApplication.Get(intApp, "tpm") != "1" && oProject.Get(intProject, "number") == "") { oProject.Update(intProject, oProjectNumber.New()); } if (chkEmail.Checked == false) { if (intItem != intImplementorDistributed && intItem != intImplementorMidrange) { string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT"); //if (oProject.Get(intProject, "number").StartsWith("CV") == false) // strNotify = "<p><span style=\"color:#0000FF\"><b>PROJECT COORDINATOR:</b> Please allocate the hours listed above for each resource in Clarity.</span></p>"; if (strDefault == "") { oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>", true, false); } else { if (intProject > 0) { oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } else { oFunction.SendEmail("Request Assignment: " + strService, oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment: " + strService, "<p><b>The following request has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } } string strActivity = "<tr><td><b>Resource:</b></td><td> </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 if (chkEmail.Checked == false) { string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT"); if (strDefault == "") { oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p>", true, false); } else { if (intProject > 0) { oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } else { oFunction.SendEmail("Request Assignment", oUser.GetName(intAssigned), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following project has been assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oProjectRequest.GetBody(intRequest, intEnvironment, true) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } } string strExecutive = oProject.Get(intProject, "executive"); string strWorking = oProject.Get(intProject, "working"); string strActivity = "<tr><td><b>Resource:</b></td><td> </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); } } } } else { // Update Assignee int intResourceWorkflow = Int32.Parse(dsWorkflow.Tables[0].Rows[0]["id"].ToString()); int intOldUser = Int32.Parse(dsWorkflow.Tables[0].Rows[0]["userid"].ToString()); if (chkEmail.Checked == false) { string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_ASSIGNMENT"); string strSpacerRow = "<tr><td colspan=\"3\"><img src=\"" + oVariable.ImageURL() + "/images/spacer.gif\" border=\"0\" width=\"1\" height=\"7\" /></td></tr>"; string strDefault = oUser.GetApplicationUrl(intUser, intViewPage); // Notify Old User // NOTIFICATION oFunction.SendEmail("Request Assignment", oUser.GetName(intOldUser), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following request has been removed from your workload</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>", true, false); // Notify New User if (strDefault == "") { oFunction.SendEmail("Request Assignment", oUser.GetName(intUser), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following request has been re-assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p>", true, false); } else { if (intProject > 0) { oFunction.SendEmail("Request Assignment", oUser.GetName(intUser), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following request has been re-assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(intViewPage) + "?pid=" + intProject.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } else { oFunction.SendEmail("Request Assignment", oUser.GetName(intUser), "", strEMailIdsBCC, "Request Assignment", "<p><b>The following request has been re-assigned to you by " + oUser.GetFullName(intProfile) + "</b><p><p>" + oResourceRequest.GetWorkflowSummary(intResourceWorkflow, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP) + "</p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/frame/resource_request.aspx?rrid=" + intResourceWorkflow.ToString() + "\" target=\"_blank\">Click here to review your new assignment.</a></p>", true, false); } } string strActivity = "<tr><td><b>Resource:</b></td><td> </td><td>" + oUser.GetFullName(intUser) + "</td></tr>"; strActivity += strSpacerRow; strActivity += "<tr><td><b>Activity Type:</b></td><td> </td><td>" + oService.GetName(intService) + "</td></tr>"; strActivity = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strActivity + "</table>"; string strDeliverable = oApplication.Get(intApp, "deliverables_doc"); if (strDeliverable.Trim() != "") { strDeliverable = "<p><a href=\"" + oVariable.URL() + strDeliverable + "\">Click here to view the service deliverables</a></p>"; } } oResourceRequest.UpdateWorkflowAssigned(intResourceWorkflow, intUser); } } } } return(intReturn); }