protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oPage = new Pages(intProfile, dsn); oOrganization = new Organizations(intProfile, dsn); oSegment = new Segment(intProfile, dsn); oApplication = new Applications(intProfile, dsn); oRequestItem = new RequestItems(intProfile, dsn); oService = new Services(intProfile, dsn); oSearch = new Search(intProfile, dsn); oUser = new Users(intProfile, dsn); oServiceRequest = new ServiceRequests(intProfile, dsn); oResourceRequest = new ResourceRequest(intProfile, dsn); oProject = new Projects(intProfile, dsn); oStatusLevel = new StatusLevels(); oProjectRequest = new ProjectRequest(intProfile, dsn); oDocument = new Documents(intProfile, dsn); oStatus = new StatusLevels(); oApprove = new ProjectRequest_Approval(intProfile, dsn, intEnvironment); oCustomized = new Customized(intProfile, dsn); oVariable = new Variables(intEnvironment); 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); } bool boolUserSearch = false; if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "") { int intProject = Int32.Parse(Request.QueryString["pid"]); strProjectName = oProject.GetName(intProject); lblProjectName.Text = """ + strProjectName + """; // INVOLVEMENT DataSet dsInvolvement = oResourceRequest.GetWorkflowProject(intProject); int intOldUser = 0; foreach (DataRow dr in dsInvolvement.Tables[0].Rows) { if (intOldUser == Int32.Parse(dr["userid"].ToString())) { dr.Delete(); } else { intOldUser = Int32.Parse(dr["userid"].ToString()); } } dsInvolvement = oResourceRequest.GetWorkflowProject(intProject); int intOldItem = 0; intOldUser = 0; foreach (DataRow dr in dsInvolvement.Tables[0].Rows) { if (intOldItem == Int32.Parse(dr["itemid"].ToString()) && intOldUser == Int32.Parse(dr["userid"].ToString())) { dr.Delete(); } else { intOldItem = Int32.Parse(dr["itemid"].ToString()); intOldUser = Int32.Parse(dr["userid"].ToString()); } } rptInvolvement.DataSource = dsInvolvement; rptInvolvement.DataBind(); lblNoInvolvement.Visible = (rptInvolvement.Items.Count == 0); foreach (RepeaterItem ri in rptInvolvement.Items) { Label _id = (Label)ri.FindControl("lblId"); Label _user = (Label)ri.FindControl("lblUser"); Label _status = (Label)ri.FindControl("lblStatus"); Label _image = (Label)ri.FindControl("lblImage"); int intStatus = Int32.Parse(_status.Text); int intUser = Int32.Parse(_user.Text); _user.Text = oUser.GetFullName(intUser); Label _item = (Label)ri.FindControl("lblItem"); int intItem2 = Int32.Parse(_item.Text); Label _allocated = (Label)ri.FindControl("lblAllocated"); Label _used = (Label)ri.FindControl("lblUsed"); double dblAllocated = oResourceRequest.GetAllocated(intProject, intUser, intItem2); double dblUsed = oResourceRequest.GetUsed(intProject, intUser, intItem2); Label _percent = (Label)ri.FindControl("lblPercent"); _allocated.Text = dblAllocated.ToString(); _used.Text = dblUsed.ToString(); if (dblAllocated > 0) { dblUsed = dblUsed / dblAllocated; _percent.Text = dblUsed.ToString("P"); } else { _percent.Text = dblAllocated.ToString("P"); } bool boolTPMDone = false; if (intItem2 == 0) { _item.Text = "Project Coordinator"; } else if (intItem2 == -1) { _item.Text = "Design Implementation (Pending Execution)"; } else { int intApp = oRequestItem.GetItemApplication(intItem2); _item.Text = oApplication.GetName(intApp); } _status.Text = oStatus.Name(intStatus); if (boolTPMDone == true) { _status.Text = "Closed"; } } } }
protected void LoadSearch(int _search) { Search oSearch = new Search(intProfile, dsn); RequestItems oRequestItem = new RequestItems(intProfile, dsn); Services oService = new Services(intProfile, dsn); Applications oApplication = new Applications(intProfile, dsn); StatusLevels oStatusLevel = new StatusLevels(); Users oUser = new Users(intProfile, dsn); Projects oProject = new Projects(intProfile, dsn); ResourceRequest oResourceRequest = new ResourceRequest(intProfile, dsn); ServiceRequests oServiceRequest = new ServiceRequests(intProfile, dsn); DataSet ds = oSearch.GetProject(_search); int intApplication = 0; 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 (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["userid"].ToString() == intProfile.ToString()) { string strType = ds.Tables[0].Rows[0]["type"].ToString(); string strClause = "cv_projects.deleted = 0 AND cv_projects.number NOT LIKE 'CV%' AND cv_projects.number NOT LIKE 'EPS%'"; string strOr1 = ""; string strOr2 = ""; string strSQL = "SELECT DISTINCT '?pid=' + CAST(cv_projects.projectid AS varchar(10)) + '&sid=" + _search.ToString() + "' AS query, cv_projects.name, cv_projects.number, cv_projects.status, cv_projects.modified FROM cv_projects INNER JOIN cv_requests LEFT OUTER JOIN cv_service_requests ON cv_service_requests.requestid = cv_requests.requestid AND cv_service_requests.deleted = 0 LEFT OUTER JOIN cv_project_requests ON cv_project_requests.requestid = cv_requests.requestid AND cv_project_requests.deleted = 0 INNER JOIN cv_resource_requests INNER JOIN cv_request_items INNER JOIN cv_applications ON cv_request_items.applicationid = cv_applications.applicationid AND cv_applications.deleted = 0 ON cv_request_items.itemid = cv_resource_requests.itemid AND cv_request_items.deleted = 0 INNER JOIN cv_users ON cv_resource_requests.userid = cv_users.userid AND cv_users.deleted = 0 AND cv_users.enabled = 1 ON cv_requests.requestid = cv_resource_requests.requestid AND cv_resource_requests.deleted = 0 ON cv_requests.projectid = cv_projects.projectid AND cv_requests.deleted = 0 WHERE "; string strApplication = " AND cv_request_items.applicationid = " + intApplication.ToString(); switch (strType) { case "O": strApplication = ""; string strOName = ds.Tables[0].Rows[0]["oname"].ToString().Trim(); string strONumber = ds.Tables[0].Rows[0]["onumber"].ToString().Trim(); if (strONumber != "") { strClause += " AND cv_projects.number LIKE '%" + strONumber + "%'"; lblResults.Text = "Project Number LIKE "" + strONumber + """; } else { strClause += " AND cv_projects.name LIKE '%" + strOName + "%'"; lblResults.Text = "Project Name LIKE "" + strOName + """; } string strOStatus = ds.Tables[0].Rows[0]["ostatus"].ToString(); if (strOStatus != "0") { strClause += " AND cv_projects.status = " + strOStatus; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Status = "" + oStatusLevel.Name(Int32.Parse(strOStatus)) + """; } string strOStart = ds.Tables[0].Rows[0]["ostart"].ToString(); if (strOStart != "") { strOStart = DateTime.Parse(strOStart).ToShortDateString(); strClause += " AND cv_projects.modified > " + strOStart; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Project Date > "" + strOStart + """; } string strOEnd = ds.Tables[0].Rows[0]["oend"].ToString(); if (strOEnd != "") { strOEnd = DateTime.Parse(strOEnd).ToShortDateString(); strClause += " AND cv_projects.modified < " + strOEnd; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Project Date < "" + strOEnd + """; } break; case "P": string strDepartment = ds.Tables[0].Rows[0]["department"].ToString(); if (strDepartment == "0") { strApplication = ""; lblResults.Text += "Department = "ALL""; } else { strApplication = " AND cv_request_items.applicationid = " + strDepartment; lblResults.Text += "Department = "" + oApplication.GetName(Int32.Parse(strDepartment)) + """; } string strDStatus = ds.Tables[0].Rows[0]["dstatus"].ToString(); if (strDStatus != "0") { strClause += " AND cv_resource_requests.status = " + strDStatus; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Status = "" + oStatusLevel.Name(Int32.Parse(strDStatus)) + """; } string strDStart = ds.Tables[0].Rows[0]["dstart"].ToString(); if (strDStart != "") { strDStart = DateTime.Parse(strDStart).ToShortDateString(); strClause += " AND cv_requests.modified > " + strDStart; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Request Date > "" + strDStart + """; } string strDEnd = ds.Tables[0].Rows[0]["dend"].ToString(); if (strDEnd != "") { strDEnd = DateTime.Parse(strDEnd).ToShortDateString(); strClause += " AND cv_requests.modified < " + strDEnd; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Request Date < "" + strDEnd + """; } break; case "T": string strTechnician = ds.Tables[0].Rows[0]["technician"].ToString(); if (strTechnician != "0") { strClause += " AND cv_resource_requests.userid = " + strTechnician; lblResults.Text += "Technician = "" + oUser.GetFullName(Int32.Parse(strTechnician)) + """; } string strTStatus = ds.Tables[0].Rows[0]["tstatus"].ToString(); if (strTStatus != "0") { strClause += " AND cv_resource_requests.status = " + strTStatus; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Status = "" + oStatusLevel.Name(Int32.Parse(strTStatus)) + """; } string strTStart = ds.Tables[0].Rows[0]["tstart"].ToString(); if (strTStart != "") { strTStart = DateTime.Parse(strTStart).ToShortDateString(); strClause += " AND cv_requests.modified > " + strTStart; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Request Date > "" + strTStart + """; } string strTEnd = ds.Tables[0].Rows[0]["tend"].ToString(); if (strTEnd != "") { strTEnd = DateTime.Parse(strTEnd).ToShortDateString(); strClause += " AND cv_requests.modified < " + strTEnd; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Request Date < "" + strTEnd + """; } break; case "L": string strLead = ds.Tables[0].Rows[0]["lead"].ToString(); if (strLead != "0") { int intLead = Int32.Parse(strLead); strClause += " AND cv_users.manager = " + intLead.ToString(); lblResults.Text += "Team Lead = "" + oUser.GetFullName(intLead) + """; } string strLStatus = ds.Tables[0].Rows[0]["lstatus"].ToString(); if (strLStatus != "0") { strClause += " AND cv_resource_requests.status = " + strLStatus; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Status = "" + oStatusLevel.Name(Int32.Parse(strLStatus)) + """; } string strLStart = ds.Tables[0].Rows[0]["lstart"].ToString(); if (strLStart != "") { strLStart = DateTime.Parse(strLStart).ToShortDateString(); strClause += " AND cv_requests.modified > " + strLStart; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Request Date < "" + strLStart + """; } string strLEnd = ds.Tables[0].Rows[0]["lend"].ToString(); if (strLEnd != "") { strLEnd = DateTime.Parse(strLEnd).ToShortDateString(); strClause += " AND cv_requests.modified < " + strLEnd; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Request Date > "" + strLEnd + """; } break; case "G": string strItem = ds.Tables[0].Rows[0]["itemid"].ToString(); if (strItem != "0") { strClause += " AND cv_resource_requests.itemid = " + strItem; lblResults.Text += "Activity Type = "" + oRequestItem.GetItemName(Int32.Parse(strItem)) + """; } string strGStatus = ds.Tables[0].Rows[0]["gstatus"].ToString(); if (strGStatus != "0") { strClause += " AND cv_resource_requests.status = " + strGStatus; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Status = "" + oStatusLevel.Name(Int32.Parse(strGStatus)) + """; } string strGStart = ds.Tables[0].Rows[0]["gstart"].ToString(); if (strGStart != "") { strGStart = DateTime.Parse(strGStart).ToShortDateString(); strClause += " AND cv_requests.modified > " + strGStart; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Request Date < "" + strGStart + """; } string strGEnd = ds.Tables[0].Rows[0]["gend"].ToString(); if (strGEnd != "") { strGEnd = DateTime.Parse(strGEnd).ToShortDateString(); strClause += " AND cv_requests.modified < " + strGEnd; if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Request Date > "" + strGEnd + """; } break; case "S": break; } strClause = strClause + strApplication; if (strOr1 != "" && strOr2 != "") { strClause = strClause + " AND " + strOr1 + " AND cv_project_requests.id IS NOT NULL OR " + strClause + " AND " + strOr1 + " AND cv_service_requests.id IS NOT NULL OR " + strClause + " AND " + strOr2 + " AND cv_project_requests.id IS NOT NULL OR " + strClause + " AND " + strOr2 + " AND cv_service_requests.id IS NOT NULL"; } else { strClause = strClause + " AND cv_project_requests.id IS NOT NULL OR " + strClause + " AND cv_service_requests.id IS NOT NULL"; } ds = SqlHelper.ExecuteDataset(dsn, CommandType.Text, strSQL + strClause); DataView dv = ds.Tables[0].DefaultView; if (Request.QueryString["sort"] != null) { dv.Sort = Request.QueryString["sort"]; } rptView.DataSource = dv; rptView.DataBind(); foreach (RepeaterItem ri in rptView.Items) { Label _progress = (Label)ri.FindControl("lblProgress"); Label _status = (Label)ri.FindControl("lblStatus"); _status.Text = oStatusLevel.HTML(Int32.Parse(_status.Text)); Label _updated = (Label)ri.FindControl("lblUpdated"); Label _number = (Label)ri.FindControl("lblNumber"); if (_number.Text == "") { _number.Text = "<i>TBD...</i>"; } double dblUsed = 0.00; double dblAllocated = 0.00; if (_progress.Text.Contains("?pid=") == true) { int intProject = 0; if (Request.QueryString["sid"] != null && Request.QueryString["sid"] != "") { string strProgress = _progress.Text.Substring(0, _progress.Text.IndexOf("&")); intProject = Int32.Parse(strProgress.Substring(5)); } else { intProject = Int32.Parse(_progress.Text.Substring(5)); } _updated.Text = oProject.GetLastUpdated(intProject); DataSet dsAll = oResourceRequest.GetWorkflowProject(intProject); foreach (DataRow drAll in dsAll.Tables[0].Rows) { int intResourceWorkflow = Int32.Parse(drAll["id"].ToString()); dblAllocated += double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated")); dblUsed += oResourceRequest.GetWorkflowUsed(intResourceWorkflow); } } else if (_progress.Text.Contains("?rid=") == true) { int intRequest = Int32.Parse(_progress.Text.Substring(5)); DataSet dsAll = oResourceRequest.GetWorkflowRequestAll(intRequest); foreach (DataRow drAll in dsAll.Tables[0].Rows) { int intResourceWorkflow = Int32.Parse(drAll["id"].ToString()); dblAllocated += double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated")); dblUsed += oResourceRequest.GetWorkflowUsed(intResourceWorkflow); } } double dblProgress = 0.00; if (dblAllocated > 0.00) { dblProgress = (dblUsed / dblAllocated) * 100.00; } _progress.Text = oServiceRequest.GetStatusBar(dblProgress, "100", "6", true); } lblNone.Visible = (rptView.Items.Count == 0); } } }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { StringBuilder sb = new StringBuilder(strQuestions); oForecast = new Forecast(intProfile, dsn); oUser = new Users(intProfile, dsn); oProject = new Projects(intProfile, dsn); oProjectPending = new ProjectsPending(intProfile, dsn, intEnvironment); oRequest = new Requests(intProfile, dsn); oOrganization = new Organizations(intProfile, dsn); oStatusLevel = new StatusLevels(); oPlatform = new Platforms(intProfile, dsn); oModel = new Models(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); int intForecast = Int32.Parse(Request.QueryString["id"]); if (!IsPostBack) { Document doc = new Document(); iTextSharp.text.Table oTable = new iTextSharp.text.Table(2); oTable.BorderWidth = 0; oTable.BorderColor = new iTextSharp.text.Color(255, 255, 255); oTable.Padding = 2; oTable.Width = 100; iTextSharp.text.Font oFontHeader = new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 10, 1); iTextSharp.text.Font oFontBold = new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 8, 1); iTextSharp.text.Font oFont = new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 8, 0); if (Request.QueryString["export"] != null) { PdfWriter.GetInstance(doc, Response.OutputStream); string strHeader = "ClearView Design Summary"; HeaderFooter header = new HeaderFooter(new Phrase(strHeader, new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 6)), false); header.Border = iTextSharp.text.Rectangle.NO_BORDER; header.Alignment = 2; doc.Header = header; string strFooter = DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString(); HeaderFooter footer = new HeaderFooter(new Phrase(strFooter, new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 6)), false); footer.Border = iTextSharp.text.Rectangle.NO_BORDER; footer.Alignment = 2; doc.Footer = footer; doc.Open(); //iTextSharp.text.Image gif = iTextSharp.text.Image.GetInstance(Request.MapPath("~/images/nc_logo.gif")); //gif.Alignment = iTextSharp.text.Image.RIGHT_ALIGN; //gif.ScalePercent(50f); // change it's size //doc.Add(gif); Cell cell = new Cell(new Phrase("General Information", oFontHeader)); cell.Colspan = 2; cell.BackgroundColor = new iTextSharp.text.Color(204, 204, 204); oTable.AddCell(cell); } DataSet ds = oForecast.Get(intForecast); int intRequest = 0; sb.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"3\" border=\"0\">"); sb.Append("<tr><td colspan=\"2\" class=\"header\">General Information</td></tr>"); if (ds.Tables[0].Rows.Count > 0) { oTable.AddCell(new Cell(new Phrase("Requestor:", oFontBold))); oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())), oFont))); sb.Append("<tr><td nowrap>Requestor:</td><td width=\"100%\">"); sb.Append(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString()))); sb.Append("</td></tr>"); oTable.AddCell(new Cell(new Phrase("Submission Date:", oFontBold))); oTable.AddCell(new Cell(new Phrase(DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToLongDateString(), oFont))); sb.Append("<tr><td nowrap>Submission Date:</td><td width=\"100%\">"); sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToLongDateString()); sb.Append("</td></tr>"); intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString()); } int intManager = 0; int intEngineer = 0; int intLead = 0; int intProject = oRequest.GetProjectNumber(intRequest); if (intProject > 0) { DataSet dsProject = oProject.Get(intProject); if (dsProject.Tables[0].Rows.Count > 0) { oTable.AddCell(new Cell(new Phrase("Project Name:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dsProject.Tables[0].Rows[0]["name"].ToString(), oFont))); oTable.AddCell(new Cell(new Phrase("Initiative Type:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dsProject.Tables[0].Rows[0]["bd"].ToString(), oFont))); oTable.AddCell(new Cell(new Phrase("Organization:", oFontBold))); oTable.AddCell(new Cell(new Phrase(oOrganization.GetName(Int32.Parse(dsProject.Tables[0].Rows[0]["organization"].ToString())), oFont))); oTable.AddCell(new Cell(new Phrase("Project Number:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dsProject.Tables[0].Rows[0]["number"].ToString(), oFont))); oTable.AddCell(new Cell(new Phrase("Project Status:", oFontBold))); oTable.AddCell(new Cell(new Phrase(oStatusLevel.Name(Int32.Parse(dsProject.Tables[0].Rows[0]["status"].ToString())), oFont))); sb.Append("<tr><td nowrap>Project Name:</td><td width=\"100%\">"); sb.Append(dsProject.Tables[0].Rows[0]["name"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td nowrap>Initiative Type:</td><td width=\"100%\">"); sb.Append(dsProject.Tables[0].Rows[0]["bd"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td nowrap>Organization:</td><td width=\"100%\">"); sb.Append(oOrganization.GetName(Int32.Parse(dsProject.Tables[0].Rows[0]["organization"].ToString()))); sb.Append("</td></tr>"); sb.Append("<tr><td nowrap>Project Number:</td><td width=\"100%\">"); sb.Append(dsProject.Tables[0].Rows[0]["number"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td nowrap>Project Status:</td><td width=\"100%\">"); sb.Append(oStatusLevel.HTML(Int32.Parse(dsProject.Tables[0].Rows[0]["status"].ToString()))); sb.Append("</td></tr>"); intManager = Int32.Parse(dsProject.Tables[0].Rows[0]["lead"].ToString()); intEngineer = Int32.Parse(dsProject.Tables[0].Rows[0]["engineer"].ToString()); intLead = Int32.Parse(dsProject.Tables[0].Rows[0]["technical"].ToString()); } } else { DataSet dsPending = oProjectPending.GetRequest(intRequest); if (dsPending.Tables[0].Rows.Count > 0) { oTable.AddCell(new Cell(new Phrase("Project Name:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dsPending.Tables[0].Rows[0]["name"].ToString(), oFont))); oTable.AddCell(new Cell(new Phrase("Initiative Type:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dsPending.Tables[0].Rows[0]["bd"].ToString(), oFont))); oTable.AddCell(new Cell(new Phrase("Organization:", oFontBold))); oTable.AddCell(new Cell(new Phrase(oOrganization.GetName(Int32.Parse(dsPending.Tables[0].Rows[0]["organization"].ToString())), oFont))); oTable.AddCell(new Cell(new Phrase("Project Number:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dsPending.Tables[0].Rows[0]["number"].ToString(), oFont))); oTable.AddCell(new Cell(new Phrase("Project Status:", oFontBold))); oTable.AddCell(new Cell(new Phrase("PENDING", oFont))); sb.Append("<tr><td nowrap>Project Name:</td><td width=\"100%\">"); sb.Append(dsPending.Tables[0].Rows[0]["name"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td nowrap>Initiative Type:</td><td width=\"100%\">"); sb.Append(dsPending.Tables[0].Rows[0]["bd"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td nowrap>Organization:</td><td width=\"100%\">"); sb.Append(oOrganization.GetName(Int32.Parse(dsPending.Tables[0].Rows[0]["organization"].ToString()))); sb.Append("</td></tr>"); sb.Append("<tr><td nowrap>Project Number:</td><td width=\"100%\">"); sb.Append(dsPending.Tables[0].Rows[0]["number"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td nowrap>Project Status:</td><td width=\"100%\" class=\"pending\">PENDING</td></tr>"); intManager = Int32.Parse(dsPending.Tables[0].Rows[0]["lead"].ToString()); intEngineer = Int32.Parse(dsPending.Tables[0].Rows[0]["engineer"].ToString()); intLead = Int32.Parse(dsPending.Tables[0].Rows[0]["technical"].ToString()); } } if (intManager > 0) { sb.Append("<tr><td nowrap>Project Manager:</td><td width=\"100%\">"); sb.Append(oUser.GetFullName(intManager)); sb.Append("</td></tr>"); } else { sb.Append("<tr><td nowrap>Project Manager:</td><td width=\"100%\"></td></tr>"); } if (intEngineer > 0) { sb.Append("<tr><td nowrap>Integration Engineer:</td><td width=\"100%\">"); sb.Append(oUser.GetFullName(intEngineer)); sb.Append("</td></tr>"); } else { sb.Append("<tr><td nowrap>Integration Engineer:</td><td width=\"100%\"></td></tr>"); } if (intLead > 0) { sb.Append("<tr><td nowrap>Technical Lead:</td><td width=\"100%\">"); sb.Append(oUser.GetFullName(intLead)); sb.Append("</td></tr>"); } else { sb.Append("<tr><td nowrap>Technical Lead:</td><td width=\"100%\"></td></tr>"); } oTable.AddCell(new Cell(new Phrase("Project Manager:", oFontBold))); oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(intManager), oFont))); oTable.AddCell(new Cell(new Phrase("Integration Engineer:", oFontBold))); oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(intEngineer), oFont))); oTable.AddCell(new Cell(new Phrase("Technical Lead:", oFontBold))); oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(intLead), oFont))); oTable.AddCell(new Cell(new Phrase(" ", oFontBold))); oTable.AddCell(new Cell(new Phrase(" ", oFont))); Cell cell2 = new Cell(new Phrase("Line Items", oFontHeader)); cell2.Colspan = 2; cell2.BackgroundColor = new iTextSharp.text.Color(204, 204, 204); oTable.AddCell(cell2); sb.Append("<tr><td colspan=\"2\"><hr size=\"1\" noshade /></td></tr>"); sb.Append("<tr><td colspan=\"2\" class=\"header\">Line Items</td></tr>"); sb.Append("<tr><td colspan=\"2\">"); ds = oForecast.GetAnswers(intForecast); bool boolChange = false; foreach (DataRow dr in ds.Tables[0].Rows) { int intID = Int32.Parse(dr["id"].ToString()); int intPlatform = Int32.Parse(dr["platformid"].ToString()); int intClass = Int32.Parse(dr["classid"].ToString()); int intEnvir = Int32.Parse(dr["environmentid"].ToString()); double dblQuantity = double.Parse(dr["quantity"].ToString()) + double.Parse(dr["recovery_number"].ToString()); int intModel = 0; int intServerModel = oForecast.GetModelAsset(intID); if (intServerModel == 0) { intServerModel = oForecast.GetModel(intID); } if (intServerModel == 0) { // Get the model selected in the equipment dropdown (if not server) intModel = Int32.Parse(dr["modelid"].ToString()); } double dblAmp = 0.00; double dblReplicate = 0.00; string strModel = ""; if (intServerModel > 0) { dblAmp = (double.Parse(oModelsProperties.Get(intServerModel, "amp")) * dblQuantity); double.TryParse(oModelsProperties.Get(intServerModel, "replicate_times"), out dblReplicate); if (intModel == 0) { intModel = Int32.Parse(oModelsProperties.Get(intServerModel, "modelid")); } strModel = oModelsProperties.Get(intServerModel, "name"); } else if (intModel > 0) { strModel = oModel.Get(intModel, "name"); } else { DataSet dsVendor = oForecast.GetAnswer(intID); if (dsVendor.Tables[0].Rows.Count > 0 && dsVendor.Tables[0].Rows[0]["modelname"].ToString() != "") { dblAmp = (double.Parse(dsVendor.Tables[0].Rows[0]["amp"].ToString()) * dblQuantity); strModel = dsVendor.Tables[0].Rows[0]["modelname"].ToString(); } } if (intModel == 0) { strModel = "Solution Unavailable"; } // STORAGE DataSet dsStorage = oForecast.GetStorage(intID); double dblStorage = 0.00; if (dsStorage.Tables[0].Rows.Count > 0) { double dblHigh = double.Parse(dsStorage.Tables[0].Rows[0]["high_total"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["high_qa"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["high_test"].ToString()) + (double.Parse(dsStorage.Tables[0].Rows[0]["high_replicated"].ToString()) * dblReplicate) + double.Parse(dsStorage.Tables[0].Rows[0]["high_ha"].ToString()); double dblStandard = double.Parse(dsStorage.Tables[0].Rows[0]["standard_total"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["standard_qa"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["standard_test"].ToString()) + (double.Parse(dsStorage.Tables[0].Rows[0]["standard_replicated"].ToString()) * dblReplicate) + double.Parse(dsStorage.Tables[0].Rows[0]["standard_ha"].ToString()); double dblLow = double.Parse(dsStorage.Tables[0].Rows[0]["low_total"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["low_qa"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["low_test"].ToString()) + (double.Parse(dsStorage.Tables[0].Rows[0]["low_replicated"].ToString()) * dblReplicate) + double.Parse(dsStorage.Tables[0].Rows[0]["low_ha"].ToString()); dblStorage = dblHigh + dblStandard + dblLow; } sb.Append("<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color:"); sb.Append(boolChange ? "#FFFFFF" : "#F6F6F6"); sb.Append("\">"); sb.Append("<tr><td>"); sb.Append("<table width=\"100%\" cellpadding=\"5\" cellspacing=\"2\" border=\"0\">"); sb.Append("<tr><td valign=\"top\" nowrap>Nickname:</td><td>"); sb.Append(dr["name"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td valign=\"top\" nowrap>Platform:</td><td>"); sb.Append(oPlatform.GetName(intPlatform)); sb.Append("</td></tr>"); oTable.AddCell(new Cell(new Phrase("Nickname:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dr["name"].ToString(), oFont))); oTable.AddCell(new Cell(new Phrase("Platform:", oFontBold))); oTable.AddCell(new Cell(new Phrase(oPlatform.GetName(intPlatform), oFont))); oTable.AddCell(new Cell(new Phrase("Model:", oFontBold))); oTable.AddCell(new Cell(new Phrase(strModel, oFont))); oTable.AddCell(new Cell(new Phrase("Commitment Date:", oFontBold))); oTable.AddCell(new Cell(new Phrase((dr["implementation"].ToString() == "" ? "" : DateTime.Parse(dr["implementation"].ToString()).ToShortDateString()), oFont))); oTable.AddCell(new Cell(new Phrase("Quantity:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dblQuantity.ToString(), oFont))); string strPDF = oModel.Get(intModel, "pdf"); sb.Append("<tr><td valign=\"top\" nowrap>Model:</td><td width=\"100%\">"); sb.Append(strPDF == "" ? strModel : "<a href=\"javascript:void(0);\" onclick=\"OpenNewWindowMAX('" + strPDF.Replace("\\", "\\\\") + "');\">" + strModel + "</a>"); sb.Append("</td></tr>"); sb.Append("<tr><td valign=\"top\" nowrap>Commitment Date:</td><td width=\"100%\">"); sb.Append(dr["implementation"].ToString() == "" ? "" : DateTime.Parse(dr["implementation"].ToString()).ToShortDateString()); sb.Append("</td></tr>"); sb.Append("<tr><td valign=\"top\" nowrap>Quantity:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_quantity.aspx?id="); sb.Append(intID.ToString()); sb.Append("',275,200);\">"); sb.Append(dblQuantity.ToString()); sb.Append("</a></td></tr>"); double dblA = 0.00; DataSet dsA = oForecast.GetAcquisitions(intModel, 1); foreach (DataRow drA in dsA.Tables[0].Rows) { dblA += double.Parse(drA["cost"].ToString()); } sb.Append("<tr><td valign=\"top\" nowrap>Acquisition Costs:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_acquisition.aspx?id="); sb.Append(intID.ToString()); sb.Append("',400,300);\">$"); sb.Append(dblA.ToString("N")); sb.Append("</a></td></tr>"); oTable.AddCell(new Cell(new Phrase("Acquisition Costs:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dblA.ToString("N"), oFont))); double dblO = 0.00; DataSet dsO = oForecast.GetOperations(intModel, 1); foreach (DataRow drO in dsO.Tables[0].Rows) { dblO += double.Parse(drO["cost"].ToString()); } oTable.AddCell(new Cell(new Phrase("Operational Costs:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dblO.ToString("N"), oFont))); oTable.AddCell(new Cell(new Phrase("Storage:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dblStorage.ToString("N") + " GB", oFont))); oTable.AddCell(new Cell(new Phrase("AMPs:", oFontBold))); oTable.AddCell(new Cell(new Phrase(dblAmp.ToString("N") + " AMPs", oFont))); sb.Append("<tr><td valign=\"top\" nowrap>Operational Costs:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_operational.aspx?id="); sb.Append(intID.ToString()); sb.Append("',400,300);\">$"); sb.Append(dblO.ToString("N")); sb.Append("</a></td></tr>"); sb.Append("<tr><td valign=\"top\" nowrap>Storage:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_storage.aspx?id="); sb.Append(intID.ToString()); sb.Append("',650,200);\">"); sb.Append(dblStorage.ToString("N")); sb.Append(" GB</a></td></tr>"); sb.Append("<tr><td valign=\"top\" nowrap>AMPs:</td><td width=\"100%\">"); sb.Append(dblAmp.ToString("N")); sb.Append("</td></tr>"); if (Request.QueryString["checked"] != null) { sb.Append("<tr><td valign=\"top\" colspan=\"2\"><b>Questions & Responses</b></td></tr>"); DataSet dsQuestions = oForecast.GetQuestionPlatform(intPlatform, intClass, intEnvir); foreach (DataRow drQuestion in dsQuestions.Tables[0].Rows) { string strResponse = ""; string strResponsePDF = ""; int intQuestion = Int32.Parse(drQuestion["id"].ToString()); DataSet dsAnswers = oForecast.GetAnswerPlatform(intID, intQuestion); foreach (DataRow drAnswer in dsAnswers.Tables[0].Rows) { strResponse += "<tr><td valign=\"top\"></td><td> " + oForecast.GetResponse(Int32.Parse(drAnswer["responseid"].ToString()), "response") + "</td></tr>"; if (strResponsePDF != "") { strResponsePDF += ", "; } strResponsePDF += oForecast.GetResponse(Int32.Parse(drAnswer["responseid"].ToString()), "response"); } if (strResponse != "") { sb.Append("<tr><td valign=\"top\" colspan=\"2\"><table cellpadding=\"1\" cellspacing=\"1\" border=\"0\">"); sb.Append("<tr><td valign=\"top\"><img src=\"/images/help.gif\" align=\"absmiddle\" border=\"0\"/></td><td>"); sb.Append(drQuestion["question"].ToString()); sb.Append("</td></tr>"); Cell oCellQ = new Cell(new Phrase(drQuestion["question"].ToString(), oFontBold)); oCellQ.Colspan = 2; oTable.AddCell(oCellQ); Cell oCellA = new Cell(new Phrase(strResponsePDF, oFont)); oCellA.Colspan = 2; oTable.AddCell(oCellA); sb.Append(strResponse); sb.Append("</table></td></tr>"); } } } sb.Append("</table></td></tr>"); Cell oCellD = new Cell(new Phrase("", oFont)); oCellD.Colspan = 2; oCellD.BackgroundColor = new iTextSharp.text.Color(100, 100, 100); oTable.AddCell(oCellD); sb.Append("<tr height=\"1\"><td colspan=\"2\" style=\"border-bottom:dashed 1px #CCCCCC\"><img src=\"/images/spacer.gif\" border=\"0\" width=\"1\" height=\"1\" /></td></tr>"); sb.Append("</table>"); boolChange = !boolChange; } sb.Append("</td></tr>"); chkQuestions.Checked = (Request.QueryString["checked"] != null); chkQuestions.Attributes.Add("onclick", "WaitDDL('" + divWait.ClientID + "');"); if (Request.QueryString["export"] != null) { doc.Add(oTable); doc.Close(); Response.ContentType = "application/pdf"; Response.AddHeader("Content-Disposition", "attachment; filename=export.pdf"); Response.End(); Response.Flush(); } } strQuestions = sb.ToString(); } }
private string GetSummary(int _requestid, int _serviceid, int _number) { Users oUser = new Users(intProfile, dsn); ServiceRequests oServiceRequest = new ServiceRequests(intProfile, dsn); RequestItems oRequestItem = new RequestItems(intProfile, dsn); Applications oApplication = new Applications(intProfile, dsn); StatusLevels oStatus = new StatusLevels(); StringBuilder sbSummary = new StringBuilder(); DataSet ds = oResourceRequest.GetRequestService(_requestid, _serviceid, _number); int intCount = 0; foreach (DataRow dr in ds.Tables[0].Rows) { intCount++; int intResource = Int32.Parse(dr["id"].ToString()); int intItem = Int32.Parse(dr["itemid"].ToString()); int intNumber = Int32.Parse(dr["number"].ToString()); int intStatus = Int32.Parse(dr["status"].ToString()); double dblAllocated = double.Parse(dr["allocated"].ToString()); double dblProgress = 0.00; if (intStatus == 3) { dblProgress = 100.00; } else { double dblUsed = oResourceRequest.GetWorkflowUsed(intResource); if (dblAllocated > 0.00) { dblProgress = (dblUsed / dblAllocated) * 100.00; } } string strReason = "Unavailable"; int intApproval = 0; DataSet dsReason = oResourceRequest.GetApproval(_requestid, intItem, intNumber); if (dsReason.Tables[0].Rows.Count > 0) { strReason = dsReason.Tables[0].Rows[0]["reason"].ToString().Trim(); if (strReason == "") { strReason = "<i>No additional information...</i>"; } intApproval = Int32.Parse(dsReason.Tables[0].Rows[0]["approval"].ToString()); } string strStatus = oStatus.Name(intApproval); bool boolResult = (intApproval == 1); sbSummary.Append("<tr>"); sbSummary.Append("<td width=\"1\"><img src=\"/images/resource_people.gif\" border=\"0\" align=\"absmiddle\"></td>"); int intUser = Int32.Parse(dr["userid"].ToString()); sbSummary.Append("<td>"); sbSummary.Append(intUser > 0 ? oUser.GetFullName(intUser) : "Pending Assignment"); sbSummary.Append("</td>"); sbSummary.Append("<td>"); sbSummary.Append(oApplication.GetName(oRequestItem.GetItemApplication(Int32.Parse(dr["itemid"].ToString())))); sbSummary.Append("</td>"); sbSummary.Append("<td nowrap align=\"center\">"); sbSummary.Append(intUser > 0 ? strStatus : "---"); sbSummary.Append("</td>"); sbSummary.Append("<td nowrap width=\"100\">"); sbSummary.Append(intUser > 0 ? oServiceRequest.GetStatusBar(dblProgress, "100", "14", true) : "---"); sbSummary.Append("</td>"); sbSummary.Append("<td width=\"1\" nowrap><a href=\"javascript:void(0);\" onclick=\"ShowHide('div"); sbSummary.Append(intCount.ToString()); sbSummary.Append("_1');\">[Details]</a>"); sbSummary.Append(boolResult ? " <a href=\"javascript:void(0);\" onclick=\"ShowHide('div" + intCount.ToString() + "_2');\">[Result]</a>" : ""); sbSummary.Append("</td>"); sbSummary.Append("</tr>"); sbSummary.Append("<tr>"); sbSummary.Append("<td colspan=\"6\">"); sbSummary.Append("<div id=\"div"); sbSummary.Append(intCount.ToString()); sbSummary.Append("_1\" style=\"display:none\">"); sbSummary.Append(strReason); sbSummary.Append("</div>"); if (boolResult == true) { string strResult = ""; DataSet dsResult = oRequest.GetResult(_requestid, intItem, intNumber); foreach (DataRow drResult in dsResult.Tables[0].Rows) { strResult += drResult["result"].ToString(); } sbSummary.Append("<div id=\"div"); sbSummary.Append(intCount.ToString()); sbSummary.Append("_2\" style=\"display:none\">"); sbSummary.Append(strResult); sbSummary.Append("</div>"); } sbSummary.Append("</td>"); sbSummary.Append("</tr>"); } sbSummary.Insert(0, "<table width=\"100%\" cellpadding=\"3\" cellspacing=\"2\" border=\"0\"><tr><td></td><td><b><u>Technician:</u></b></td><td><b><u>Department:</u></b></td><td align=\"center\"><b><u>Status:</u></b></td><td><b><u>Progress:</u></b></td><td></td></tr>"); sbSummary.Append("</table>"); return(sbSummary.ToString()); }
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); oRequestItem = new RequestItems(intProfile, dsn); oProject = new Projects(intProfile, dsn); oPage = new Pages(intProfile, dsn); oVariable = new Variables(intEnvironment); oApplication = new Applications(intProfile, dsn); oProjectNumber = new ProjectNumber(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oRequestField = new RequestFields(intProfile, dsn); oDocument = new Documents(intProfile, dsn); oUser = new Users(intProfile, dsn); oStatus = new StatusLevels(); oService = new Services(intProfile, dsn); oDelegate = new Delegates(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["pid"] != null && Request.QueryString["pid"] != "") { int intProject = Int32.Parse(Request.QueryString["pid"]); lblProject.Text = intProject.ToString(); ds = oProject.GetCoordinator(intProject, 0); int intCoordinator = 0; int intRequest = 0; int intResource = 0; bool boolCoordinator = false; bool boolTPM = false; foreach (DataRow dr in ds.Tables[0].Rows) { if ((Int32.Parse(dr["userid"].ToString()) == intProfile || oDelegate.Get(Int32.Parse(dr["userid"].ToString()), intProfile) > 0) && (Request.QueryString["search"] == null)) { if (dr["tpm"].ToString() == "1") { boolTPM = true; } else { boolCoordinator = true; } } } if (ds.Tables[0].Rows.Count > 0) { //panProject.Visible = true; intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString()); intResource = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString()); intCoordinator = Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString()); lblCoordinator.Text = oUser.GetFullName(intCoordinator); lblPhone.Text = (oUser.Get(intCoordinator, "phone") == "" ? "N / A" : oUser.Get(intCoordinator, "phone")); string strEmail = oUser.GetEmail(oUser.GetName(intCoordinator), intEnvironment); lblEmail.Text = (strEmail == "" ? "N / A" : "<a href=\"mailto:" + strEmail + "\" target=\"_blank\">" + strEmail + "</a>"); string strPager = oUser.Get(intCoordinator, "pager"); lblMobileDevice.Text = (strPager == "" || strPager == "0" ? "N / A" : strPager); string strAt = oUser.Get(intCoordinator, "atid"); if (strAt != "0" && strAt != "") { Users_At oUserAt = new Users_At(intProfile, dsn); strPager += "@" + oUserAt.GetName(Int32.Parse(strAt)); lblMobileEmail.Text = "<a href=\"mailto:" + strPager + "\" target=\"_blank\">" + strPager + "</a>"; } else { lblMobileEmail.Text = "N / A"; } } lblRequest.Text = intRequest.ToString(); if (Request.QueryString["comm"] != null && Request.QueryString["comm"] != "") { trCommunication.Visible = true; } if (boolTPM == true) { // if (CheckConfigured(intProject, intRequest, intResource) == true) // { panControl.Visible = true; Control oControl = (Control)LoadControl(strTPMWM); phControl.Controls.Add(oControl); LoadProject(intProject); // } // else // panConfigure.Visible = true; } else if (boolCoordinator == true) { panControl.Visible = true; Control oControl = (Control)LoadControl(strPCWM); phControl.Controls.Add(oControl); LoadProject(intProject); } else if (oApplication.GetName(intApplication).Contains("IDC") == true || oApplication.GetName(intApplication).Contains("Integration Engineer") == true) { panControl.Visible = true; Control oControl = (Control)LoadControl("/controls/wm/wm_ie.ascx"); phControl.Controls.Add(oControl); LoadProject(intProject); } else { panWorkload.Visible = true; ds = oResourceRequest.GetWorkflowProjectAll(intProject); if (ds.Tables[0].Rows.Count > 0) { ds = oProjectRequest.GetProject(intProject); if (ds.Tables[0].Rows.Count > 0) { btnViewPR.Text = "View Original Project Request"; btnViewPR.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewRequest.ToString() + "&rid=" + intRequest.ToString() + "');"); } else { //if (intResource > 0) //{ // btnViewPR.Text = "View Original Request Details"; // btnViewPR.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewResourceRequest.ToString() + "&rrid=" + intResource.ToString() + "');"); //} //else btnViewPR.Visible = false; } // Documents btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?pid=" + intProject.ToString() + "');"); chkMyDescription.Checked = (Request.QueryString["mydoc"] != null); lblMyDocuments.Text = oDocument.GetDocuments_Mine(intProject, intProfile, oVariable.DocumentsFolder(), -1, (Request.QueryString["mydoc"] != null)); // GetDocuments(string _physical, int _projectid, int _requestid, int _userid, int _security, bool _show_description, bool _mine) //lblMyDocuments.Text = oDocument.GetDocuments(Request.PhysicalApplicationPath, intProject, 0, intProfile, -1, (Request.QueryString["mydoc"] != null), true); chkDescription.Checked = (Request.QueryString["doc"] != null); lblDocuments.Text = oDocument.GetDocuments_Project(intProject, intProfile, oVariable.DocumentsFolder(), 1, (Request.QueryString["doc"] != null)); // GetDocuments(string _physical, int _projectid, int _requestid, int _userid, int _security, bool _show_description, bool _mine) //lblDocuments.Text = oDocument.GetDocuments(Request.PhysicalApplicationPath, intProject, 0, intProfile, 1, (Request.QueryString["doc"] != null), false); /* * ds = oResourceRequest.GetWorkflowProject(intProject); * int intOldUser = 0; * foreach (DataRow dr in ds.Tables[0].Rows) * { * if (intOldUser == Int32.Parse(dr["userid"].ToString())) * dr.Delete(); * else * intOldUser = Int32.Parse(dr["userid"].ToString()); * } * ddlResource.DataValueField = "userid"; * ddlResource.DataTextField = "userid"; * ddlResource.DataSource = ds; * ddlResource.DataBind(); * foreach (ListItem oItem in ddlResource.Items) * oItem.Text = oUser.GetFullName(Int32.Parse(oItem.Value)); * ddlResource.Items.Insert(0, new ListItem("-- SELECT --", "0")); * // Load Involvement * DataSet dsInvolvement = oResourceRequest.GetWorkflowProject(intProject); * int intOldItem = 0; * intOldUser = 0; * foreach (DataRow dr in dsInvolvement.Tables[0].Rows) * { * if (intImplementorDistributed == Int32.Parse(dr["itemid"].ToString())) * dr.Delete(); * else if (intImplementorMidrange == Int32.Parse(dr["itemid"].ToString())) * dr.Delete(); * else if (intOldItem == Int32.Parse(dr["itemid"].ToString()) && intOldUser == Int32.Parse(dr["userid"].ToString())) * dr.Delete(); * else * { * intOldItem = Int32.Parse(dr["itemid"].ToString()); * intOldUser = Int32.Parse(dr["userid"].ToString()); * } * } * rptInvolvement.DataSource = dsInvolvement; * rptInvolvement.DataBind(); * lblNoInvolvement.Visible = (rptInvolvement.Items.Count == 0); * foreach (RepeaterItem ri in rptInvolvement.Items) * { * Label _id = (Label)ri.FindControl("lblId"); * Label _user = (Label)ri.FindControl("lblUser"); * Label _status = (Label)ri.FindControl("lblStatus"); * int intStatus = Int32.Parse(_status.Text); * int intUser = Int32.Parse(_user.Text); * _user.Text = oUser.GetFullName(intUser); * Label _item = (Label)ri.FindControl("lblItem"); * int intItem = Int32.Parse(_item.Text); * Label _allocated = (Label)ri.FindControl("lblAllocated"); * Label _used = (Label)ri.FindControl("lblUsed"); * double dblAllocated = oResourceRequest.GetAllocated(intProject, intUser, intItem); * double dblUsed = oResourceRequest.GetUsed(intProject, intUser, intItem); * Label _percent = (Label)ri.FindControl("lblPercent"); * _allocated.Text = dblAllocated.ToString(); * _used.Text = dblUsed.ToString(); * if (dblAllocated > 0) * { * dblUsed = dblUsed / dblAllocated; * _percent.Text = dblUsed.ToString("P"); * } * else * _percent.Text = dblAllocated.ToString("P"); * if (intItem == 0) * _item.Text = "Project Coordinator"; * else * { * if (intItem == -1) * _item.Text = "Design Implementor"; * else * { * int intApp = oRequestItem.GetItemApplication(intItem); * _item.Text = oApplication.GetName(intApp); * } * } * _status.Text = oStatus.Name(intStatus); * } */ // MY Involvement DataSet dsMine = oResourceRequest.GetWorkflowProject(intProject); //Check if new request DataColumn oColumn; oColumn = new DataColumn(); oColumn.DataType = System.Type.GetType("System.String"); oColumn.ColumnName = "new"; dsMine.Tables[0].Columns.Add(oColumn); foreach (DataRow dr in dsMine.Tables[0].Rows) { if (intImplementorDistributed == Int32.Parse(dr["itemid"].ToString())) { dr.Delete(); } else if (intImplementorMidrange == Int32.Parse(dr["itemid"].ToString())) { dr.Delete(); } else if (DateTime.Parse(dr["created"].ToString()) <= DateTime.Parse(dr["modified"].ToString())) { dr["new"] = "1"; } //else if (intProfile != Int32.Parse(dr["userid"].ToString()) && oDelegate.Get(Int32.Parse(dr["userid"].ToString()), intProfile) <= 0) // dr.Delete(); } Functions oFunction = new Functions(0, dsn, intEnvironment); rptMine.DataSource = dsMine; rptMine.DataBind(); lblNoMine.Visible = (rptMine.Items.Count == 0); foreach (RepeaterItem ri in rptMine.Items) { Label _id = (Label)ri.FindControl("lblId"); Label _user = (Label)ri.FindControl("lblUser"); Label _status = (Label)ri.FindControl("lblStatus"); Label _color = (Label)ri.FindControl("lblColor"); Label _service = (Label)ri.FindControl("lblServiceId"); int _serviceid = Int32.Parse(_service.Text); Label _name = (Label)ri.FindControl("lblName"); Image imgDelegate = (Image)ri.FindControl("imgDelegate"); int intStatus = Int32.Parse(_status.Text); int intUser = Int32.Parse(_user.Text); if ((intStatus < 1 || intStatus > 2) && intStatus != 5) { ri.Visible = false; } else if (intUser != intProfile) { if (oDelegate.Get(intUser, intProfile) <= 0) { ri.Visible = false; } else { imgDelegate.Visible = true; } } if (ri.Visible == true) { string strColor = _color.Text; int intGreen = 0; Int32.TryParse(strColor.Substring(0, strColor.IndexOf("_")), out intGreen); strColor = strColor.Substring(strColor.IndexOf("_") + 1); int intYellow = 0; Int32.TryParse(strColor.Substring(0, strColor.IndexOf("_")), out intYellow); strColor = strColor.Substring(strColor.IndexOf("_") + 1); int intRed = 0; Int32.TryParse(strColor, out intRed); strColor = "<table cellpadding=\"0\" cellspacing=\"2\" border=\"0\">"; if (intRed > 0) { strColor += "<tr><td>" + oFunction.GetBox("FF0000", 15, 8) + "</td>" + (intRed > 1 ? "<td> (" + intRed.ToString() + ")</td>" : "") + "</tr>"; } if (intYellow > 0) { strColor += "<tr><td>" + oFunction.GetBox("FFFF00", 15, 8) + "</td>" + (intYellow > 1 ? "<td> (" + intYellow.ToString() + ")</td>" : "") + "</tr>"; } if (intGreen > 0) { strColor += "<tr><td>" + oFunction.GetBox("00FF00", 15, 8) + "</td>" + (intGreen > 1 ? "<td> (" + intGreen.ToString() + ")</td>" : "") + "</tr>"; } strColor += "</table>"; _color.Text = strColor; if (_name.Text == "") { _name.Text = oService.GetName(_serviceid); } Label _item = (Label)ri.FindControl("lblItem"); Label _allocated = (Label)ri.FindControl("lblAllocated"); double dblAllocated = double.Parse(_allocated.Text); Label _used = (Label)ri.FindControl("lblUsed"); double dblUsed = oResourceRequest.GetWorkflowUsed(Int32.Parse(_id.Text)); Label _percent = (Label)ri.FindControl("lblPercent"); int intItem2 = Int32.Parse(_item.Text); if (intItem2 == 0) { _item.Text = "Project Coordinator"; } else { if (intItem2 == -1) { _item.Text = "Pending Execution"; } else { int intApp = oRequestItem.GetItemApplication(intItem2); _item.Text = oApplication.GetName(intApp); } } _allocated.Text = dblAllocated.ToString(); _used.Text = dblUsed.ToString(); if (dblAllocated > 0) { dblUsed = dblUsed / dblAllocated; _percent.Text = dblUsed.ToString("P"); } else { _percent.Text = dblAllocated.ToString("P"); } _status.Text = oStatus.Name(intStatus); } } } else { panDenied.Visible = true; lblTitle.Text = "Zero Dataset "; } LoadProject(intProject); } } else { panDenied.Visible = true; lblTitle.Text = "Invalid Querystring "; } btnDenied.Attributes.Add("onclick", "return CloseWindow();"); btnConfigure.Attributes.Add("onclick", "return ValidateText('" + txtNumber.ClientID + "','Please enter the project number');"); }