protected void btnResponse_Click(Object Sender, EventArgs e) { Functions oFunction = new Functions(0, dsn, intEnvironment); Users oUser = new Users(0, dsn); ResourceRequest oResourceRequest = new ResourceRequest(0, dsn); int intNumber = 0; int intUser = 0; int intResource = 0; DataSet dsRequest = oResourceRequest.GetWorkflowRequestAll(intRequest); if (dsRequest.Tables[0].Rows.Count > 0) { intNumber = Int32.Parse(dsRequest.Tables[0].Rows[0]["number"].ToString()); intUser = Int32.Parse(dsRequest.Tables[0].Rows[0]["userid"].ToString()); intResource = Int32.Parse(dsRequest.Tables[0].Rows[0]["id"].ToString()); } char chType = (intNumber == 1 ? 'E' : 'S'); string strVirtualPath = ""; string strFile = ""; if (oFile.FileName != "" && oFile.PostedFile != null) { string strExtension = oFile.FileName; string strType = strExtension.Substring(0, 3); strExtension = strExtension.Substring(strExtension.LastIndexOf(".")); 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; oFile.PostedFile.SaveAs(strPath); } oCustomized.AddMessage(intRequest, chType, txtResponse.Text, strVirtualPath, intApplication, intProfile, 0, 0); StringBuilder sb = new StringBuilder(); sb.Append("<p><a href=\""); sb.Append(oVariables.URL()); sb.Append("/redirect.aspx?referrer=/frame/resource_request.aspx?rrid="); sb.Append(intResource); sb.Append("\" target=\"_blank\">Click here to view this ticket or submit a response</a></p>"); sb.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"3\" border=\"0\" align=\"center\" style=\"border:solid 1px #CCCCCC;"); sb.Append(oVariables.DefaultFontStyle()); sb.Append("\">"); sb.Append("<tr bgcolor=\"#EEEEEE\"><td><span style=\""); sb.Append(oVariables.DefaultFontStyleHeader()); sb.Append("\">"); sb.Append(oUser.GetFullName(intProfile)); sb.Append("</span> ["); sb.Append(DateTime.Now.ToString()); sb.Append("]:</td></tr>"); sb.Append("<tr><td>"); sb.Append(oFunction.FormatText(txtResponse.Text)); sb.Append("</td></tr>"); if (strVirtualPath != "") { sb.Append("<tr><td style=\"border-bottom:dashed 1px #CCCCCC\"> </td></tr>"); sb.Append("<tr><td><img src=\""); sb.Append(oVariables.ImageURL()); sb.Append("/images/file.gif\" align=\"absmiddle\" border=\"0\"/> <a href=\""); sb.Append(oVariables.URL()); sb.Append(strVirtualPath); sb.Append("\" target=\"_blank\">"); sb.Append(strFile); sb.Append("</a></td></tr>"); } sb.Append("</table>"); string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_DEVELOPER_ALERT"); oFunction.SendEmail("Enhancement Response [CVT" + intRequest.ToString() + "]", oUser.GetName(intUser), "", strEMailIdsBCC, "Enhancement Response [#CVT" + intRequest.ToString() + "]", "<p>" + oCustomized.GetEnhancementBody(intId, intEnvironment, false) + "</p><p>" + sb.ToString() + "</p>", true, false); Response.Redirect(oPage.GetFullLink(intPage) + "?id=" + Request.QueryString["id"]); }
protected void btnSave_Click(Object Sender, EventArgs e) { oVariables = new Variables(intEnvironment); int intResourceWorkflow = Int32.Parse(lblResourceWorkflow.Text); int intResourceParent = oResourceRequest.GetWorkflowParent(intResourceWorkflow); double dblHours = 0.00; if (Request.Form["hdnHours"] != null && Request.Form["hdnHours"] != "") { dblHours = double.Parse(Request.Form["hdnHours"]); } double dblUsed = oResourceRequest.GetWorkflowUsed(intResourceWorkflow); dblHours = (dblHours - dblUsed); if (dblHours > 0.00) { oResourceRequest.UpdateWorkflowHours(intResourceWorkflow, dblHours); } oResourceRequest.UpdateWorkflowName(intResourceWorkflow, txtCustom.Text, intProfile); int intUser = oRequest.GetUser(intRequest); oResourceRequest.UpdateWorkflowStatus(intResourceWorkflow, Int32.Parse(ddlCurrentStatus.SelectedValue), true); if (intNumber == 1) { oCustomized.UpdateEnhancementStatus(intRequest, Int32.Parse(ddlCurrentStatus.SelectedValue), Int32.Parse(ddlRelease.SelectedItem.Value), radPriority.SelectedItem.Value); oCustomized.UpdateEnhancementNew(intRequest, 1); } else { oCustomized.UpdateIssueStatus(intRequest, Int32.Parse(ddlCurrentStatus.SelectedValue)); oCustomized.UpdateIssueNew(intRequest, 1); } if (txtText.Text != "") { string strXid = oUser.GetName(intUser); char chType = (intNumber == 1 ? 'E' : 'S'); string strVirtualPath = ""; string strFile = ""; if (oFile.FileName != "" && oFile.PostedFile != null) { string strExtension = oFile.FileName; string strType = strExtension.Substring(0, 3); strExtension = strExtension.Substring(strExtension.LastIndexOf(".")); 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; oFile.PostedFile.SaveAs(strPath); } oCustomized.AddMessage(intRequest, chType, txtText.Text, strVirtualPath, intApplication, intProfile, 1, 1); string strDefault = oUser.GetApplicationUrl(intUser, (intNumber == 1 ? intEnhancementPage : intIssuePage)); string strBody = oFunction.EmailComments("ClearView Administrator", txtText.Text, strVirtualPath, strFile, false); //strBody += "<table width=\"100%\" cellpadding=\"4\" cellspacing=\"3\" border=\"0\" align=\"center\" style=\"border:solid 1px #779ccc;" + oVariable.DefaultFontStyle() + "\">"; ////DataSet dsMessages = oCustomized.GetMessages(intRequest, 0); ////foreach (DataRow drMessage in dsMessages.Tables[0].Rows) ////{ //// strBody += "<tr bgcolor=\"#EEEEEE\"><td><span style=\"" + oVariable.DefaultFontStyleHeader() + "\">" + (drMessage["admin"].ToString() == "1" ? "ClearView Administrator" : oUser.GetFullName(intProfile)) + "</span> [" + DateTime.Parse(drMessage["created"].ToString()).ToString() + "]:</td></tr>"; //// strBody += "<tr><td>" + drMessage["message"].ToString() + "</td></tr>"; //// strBody += "<tr><td> </td></tr>"; ////} //strBody += "<tr bgcolor=\"#f0f7ff\"><td><span style=\"" + oVariable.DefaultFontStyleHeader() + "\">ClearView Administrator</span> [" + DateTime.Now.ToString() + "]:</td></tr>"; //strBody += "<tr><td>" + oFunction.FormatText(txtText.Text) + "</td></tr>"; //if (strVirtualPath != "") //{ // strBody += "<tr><td style=\"border-bottom:dashed 1px #CCCCCC\"> </td></tr>"; // strBody += "<tr><td><img src=\"" + oVariable.ImageURL() + "/images/file.gif\" align=\"absmiddle\" border=\"0\"/> <a href=\"" + strVirtualPath + "\" target=\"_blank\">" + strFile + "</a></td></tr>"; //} //strBody += "</table>"; if (strDefault != "") { strBody += "<p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink((intNumber == 1 ? intEnhancementPage : intIssuePage)) + "?id=" + (intNumber == 1 ? oCustomized.GetEnhancementID(intRequest) : oCustomized.GetIssueID(intRequest)) + "\" target=\"_blank\">Click here to view this ticket or submit a response</a></p>"; } //strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_DEVELOPER_ALERT"); oFunction.SendEmail((intNumber == 1 ? "Enhancement" : "Support") + " Response [CVT" + intRequest.ToString() + "]", strXid, "", oUser.GetName(intProfile), (intNumber == 1 ? "Enhancement" : "Support") + " Response [#CVT" + intRequest.ToString() + "]", "<p>" + strBody + "</p><p>" + (intNumber == 1 ? oCustomized.GetEnhancementBody(oCustomized.GetEnhancementID(intRequest), intEnvironment, false) : oCustomized.GetIssueBody(oCustomized.GetIssueID(intRequest), intEnvironment, false)) + "</p>", true, false); } // Vijay Code - End Response.Redirect(Request.Path + "?rrid=" + intResourceWorkflow.ToString() + "&div=E&save=true"); }