public static int CalculateActionStart(int intTransactionID) { int ret = -1; Model_ReportSection Rs = new Model_ReportSection(); List <Model_ReportSection> Rslist = Rs.GetListActive(); if (Rslist.Count > 0) { foreach (Model_ReportSection item in Rslist) { switch (item.ResultSectionID) { //T1 Working Philosophies case 1: Calculation_T1 cal1 = new Calculation_T1(item.ResultSectionID, intTransactionID); if (cal1.Calnow()) { ret = 0; } break; //T2 Working Traits case 2: Calculation_T2 cal2 = new Calculation_T2(item.ResultSectionID, intTransactionID); if (cal2.Calnow()) { ret = 0; } break; //T3 Working Geniuses case 3: Calculation_T3 cal3 = new Calculation_T3(item.ResultSectionID, intTransactionID); if (cal3.Calnow()) { ret = 0; } if (cal3.IsDupExtra) { ret = cal3.TransactionID; } break; //T4 nothing ??? case 4: Calculation_T4 cal4 = new Calculation_T4(item.ResultSectionID, intTransactionID); if (cal4.Calnow()) { ret = ret > 0 ? ret : 0; } break; case 5: Calculation_T5 cal5 = new Calculation_T5(item.ResultSectionID, intTransactionID); if (cal5.Calnow()) { ret = ret > 0 ? ret : 0; } break; case 6: Calculation_T6 cal6 = new Calculation_T6(item.ResultSectionID, intTransactionID); if (cal6.Calnow()) { ret = ret > 0 ? ret : 0; } break; } } } return(ret); }
public void T4Cal() { if (!string.IsNullOrEmpty(Request.QueryString["ts"])) { int tsID = int.Parse(Request.QueryString["ts"]); Calculation_T4 T4 = new Calculation_T4(4, tsID); //List<Model_UsersAssessment> T1list = T1.GetUserAss('f'); StringBuilder retF2 = new StringBuilder(); List <Model_ReportItemResult> fscore = T4.Code_SumValueBySubSection(); retF2.Append("<table class='table'>"); retF2.Append("<tr>"); retF2.Append("<td></td>"); retF2.Append("<td></td>"); retF2.Append("<td>Score</td>"); retF2.Append("<td>Geniuses Type</td>"); retF2.Append("<td>Requirement</td>"); retF2.Append("<td>Round Down</td>"); retF2.Append("<td>Ideal Score</td>"); retF2.Append("<td>Score</td>"); retF2.Append("<td>Use at Works</td>"); retF2.Append("<td>Result</td>"); retF2.Append("</tr>"); Decimal SumScore = 0.0m; decimal SumIdeal = 0.0m; foreach (Model_ReportItemResult i in fscore) { string c = string.Empty; if (i.IsAbove) { c = "Style=\"background-color:#d0c6ff;color:#0e014c\""; } if (i.IsBelow) { c = "Style=\"background-color:#d8b5a6;color:#7c1800\""; } retF2.Append("<tr " + c + ">"); retF2.Append("<td>"); retF2.Append("<p><input type=\"checkbox\" class=\"check_focus\" value=\"" + i.ResultItemTitle + "\" /></p>"); retF2.Append("</td>"); retF2.Append("<td>"); retF2.Append("<p>" + i.ResultItemTitle + "</p>"); retF2.Append("</td>"); retF2.Append("<td>"); retF2.Append("<p>" + i.Score_new + "</p>"); retF2.Append("</td>"); retF2.Append("<td>"); retF2.Append("<p>" + i.GT + "</p>"); retF2.Append("</td>"); retF2.Append("<td>"); retF2.Append("<p>" + i.RqScore + "</p>"); retF2.Append("</td>"); retF2.Append("<td>"); retF2.Append("<p>" + (int)i.RqScore + "</p>"); retF2.Append("</td>"); retF2.Append("<td>"); retF2.Append("<p>" + i.IdealScore + "</p>"); retF2.Append("</td>"); retF2.Append("<td>"); retF2.Append("<p>" + i.ResultScore + "</p>"); retF2.Append("</td>"); retF2.Append("<td>"); retF2.Append("<p>" + i.UseAtWork + "</p>"); retF2.Append("</td>"); retF2.Append("<td>"); retF2.Append("<p>" + i.Result + "</p>"); retF2.Append("</td>"); retF2.Append("</tr>"); SumScore = SumScore + (decimal)i.ResultScore; SumIdeal = SumIdeal + (decimal)i.IdealScore; } retF2.Append("</table>"); Literal3.Text = retF2.ToString(); StringBuilder retchH = new StringBuilder(); retchH.Append("<table class='table table-strip'>"); retchH.Append("<tr>"); retchH.Append("<td>Sum Score</td><td>Ideal Score</td><td>Raw % Result</td><td>% Adjusted Result</td><td>Current Job Fit Score</td>"); retchH.Append("</tr>"); decimal RawResult = 0.0m; decimal AdjustREsult = 0.0m; decimal CurrentJobFitScore = 0.0m; if (SumScore > 0) { RawResult = SumScore / SumIdeal; AdjustREsult = RawResult + (decimal)0.1; CurrentJobFitScore = Math.Round(AdjustREsult * 100, 0); } retchH.Append("<tr>"); retchH.Append("<td>" + SumScore + "</td><td>" + SumIdeal + "</td><td>" + RawResult + "</td><td>" + AdjustREsult + "</td><td>" + CurrentJobFitScore + "</td>"); retchH.Append("</tr>"); retchH.Append("</table>"); Literal2.Text = retchH.ToString(); T4.RecordResult(fscore); } }