private void SetValue() { try { var courseId = Guid.Empty; var coursebll = new BLL.Course(); if (!string.IsNullOrEmpty(Request.QueryString["cid"])) { courseId = new Guid(Request.QueryString["cid"]); hCourseid.Value = courseId.ToString(); } else //取个默认的 { courseId = coursebll.GetTop1Guid(); hCourseid.Value = courseId.ToString(); } var courseModel = coursebll.GetModel(courseId); courseName.InnerText = courseModel.CourseName; coursePlace.InnerText = courseModel.TeachPlace; teacherName.InnerText = courseModel.TeacherName; trainTime.InnerText = courseModel.TeachTime; var question = new BLL.Questionnaire(); var dsResult = question.GetReportTile(courseId); if (dsResult != null && dsResult.Tables.Count > 0) { var row = dsResult.Tables[0].Rows[0]; spTotalAvg.InnerText = string.Format("{0:N2}", row["totalAvg"]) + " 分(满分52)"; satisfaction.InnerText =Convert.ToDouble(row["Satisfy"])>=1.0? "100%": string.Format("{0:N2}" + "%", ((Convert.ToDecimal(row["Satisfy"])) * 100)); level.InnerText = question.GetLevel((Convert.ToDouble(row["Satisfy"]))); } var dsrr = question.GetTotalReport(); if (dsrr != null && dsrr.Rows.Count > 0) { var result = dsrr.Select(string.Format(" CourseId='{0}'",courseId)); if (result.Length > 0) { divCourseContent.InnerText = Convert.ToDouble(result[0]["TotalCourse"]) >= 1.0 ? "100%" : string.Format("{0:N2}" + "%", ((Convert.ToDecimal(result[0]["TotalCourse"])) * 100)); divTeacher.InnerText = Convert.ToDouble(result[0]["TotalTeacher"]) >= 1.0 ? "100%" : string.Format("{0:N2}" + "%", ((Convert.ToDecimal(result[0]["TotalTeacher"])) * 100)); divOrg.InnerText = Convert.ToDouble(result[0]["TotalOrg"]) >= 1.0 ? "100%" : string.Format("{0:N2}" + "%", ((Convert.ToDecimal(result[0]["TotalOrg"])) * 100)); } } //var totalAvg = question.GetTotalAvg(courseId.ToString()); //spTotalAvg.InnerText = totalAvg.ToString(); //satisfaction.InnerText = string.Format("{0:N2}" + "%", (((float) totalAvg/52)*100)); //level.InnerText = question.GetLevel(((float)totalAvg / 52)); var statifyPercent = question.GetSatisfyPercent(courseId); if (statifyPercent != null) { htp1.Value = string.Format("{0:N2}", ((statifyPercent[0])*100)); htp2.Value = string.Format("{0:N2}", ((statifyPercent[1]) * 100)); htp3.Value = string.Format("{0:N2}", ((statifyPercent[2]) * 100)); htp4.Value = string.Format("{0:N2}", ((statifyPercent[3]) * 100)); htp5.Value = string.Format("{0:N2}", ((statifyPercent[4]) * 100)); // nofinish.InnerText = statifyPercent[5].ToString(); totalPeople.InnerText = statifyPercent[6].ToString()+" 人"; totalDone.InnerText = statifyPercent[7].ToString() + " 人"; evProgress.InnerText = string.Format("{0:N2}%", ((statifyPercent[7] / statifyPercent[6]) * 100)); } SetDetail(courseId); #region old tendency //var tendency = question.GetTendency(courseId); //if (tendency != null) //{ // htot1.Value = string.Format("{0:N2}", ((tendency[0]) )); // htot2.Value = string.Format("{0:N2}", ((tendency[1]))); // htot3.Value = string.Format("{0:N2}", ((tendency[2]))); // htot4.Value = string.Format("{0:N2}", ((tendency[3]))); // htot5.Value = string.Format("{0:N2}", ((tendency[4]))); //} #endregion #region old the six //var theTop6 = question.GetTheSix(courseId, true); //if (theTop6 != null) //{ // var result = new StringBuilder(); // var i = 0; // foreach (var thetop in theTop6) // { // i++; // result.Append(i + "、" + thetop + @"<br>"); // } // top6.InnerHtml = result.ToString(); //} //var theBottom6 = question.GetTheSix(courseId, false); //if (theBottom6 != null) //{ // var result = new StringBuilder(); // var i = 0; // foreach (var thebop in theBottom6) // { // i++; // result.Append(i + "、" + thebop + @"<br>"); // } // bot6.InnerHtml = result.ToString(); //} #endregion } catch (Exception ex) { LogHelper.WriteLogofExceptioin(ex); } }
private string GetReportData(string coursId, out string courseName) { var coid = new Guid(coursId); var couBll = new BLL.Course(); var courseModel = couBll.GetModel(coid); courseName = courseModel.CourseName; var report = new BLL.Questionnaire(); var reportTitle = report.GetReportTile(coid); var reportBody = report.GetReport(coid); var totalShould = 0; var totalPrac = 0; var totalScor = ""; var satisfy = ""; var level = "良好"; var contenScor = ""; var techScor = ""; var orgScor = ""; if (reportTitle != null && reportTitle.Tables.Count > 0) { totalShould = Convert.ToInt32(reportTitle.Tables[0].Rows[0]["totalNum"]); totalPrac = Convert.ToInt32(reportTitle.Tables[0].Rows[0]["totalDone"]); totalScor = string.Format("{0:N2}" , Convert.ToDouble(reportTitle.Tables[0].Rows[0]["totalAvg"])); satisfy = string.Format("{0:N2}", Convert.ToDouble(reportTitle.Tables[0].Rows[0]["Satisfy"])*100); level = report.GetLevel(Convert.ToDouble(reportTitle.Tables[0].Rows[0]["Satisfy"])); contenScor = string.Format("{0:N2}" , Convert.ToDouble(reportTitle.Tables[0].Rows[0]["CourseAvg"])); techScor = string.Format("{0:N2}" , Convert.ToDouble(reportTitle.Tables[0].Rows[0]["TeacherAvg"])); orgScor = string.Format("{0:N2}", Convert.ToDouble(reportTitle.Tables[0].Rows[0]["OrgAvg"])); } var result = new Dictionary<int, double[]>(); if (reportBody != null && reportBody.Tables.Count > 0) { foreach (DataRow row in reportBody.Tables[0].Rows) { result.Add((int)row["num"], new[] { Convert.ToDouble(row["top1"]), Convert.ToDouble(row["top2"]), Convert.ToDouble(row["top3"]), Convert.ToDouble(row["top4"]), Convert.ToDouble(row["top5"]) }); } } var allTop1 = string.Format("{0:N2}"+"%", result[1][0]*100); var allTop2 = string.Format("{0:N2}" + "%", result[1][1] * 100); var allTop3 = string.Format("{0:N2}" + "%", result[1][2] * 100); var allTop4 = string.Format("{0:N2}" + "%", result[1][3] * 100); var allTop5 = string.Format("{0:N2}" + "%", result[1][4] * 100); var content1Top1 = result[2][0]; var content1Top2 = result[2][1]; var content1Top3 = result[2][2]; var content1Top4 = result[2][3]; var content1Top5 = result[2][4]; var content2Top1 = result[3][0]; var content2Top2 = result[3][1]; var content2Top3 = result[3][2]; var content2Top4 = result[3][3]; var content2Top5 = result[3][4]; var content3Top1 = result[4][0]; var content3Top2 = result[4][1]; var content3Top3 = result[4][2]; var content3Top4 = result[4][3]; var content3Top5 = result[4][4]; var content4Top1 = result[5][0]; var content4Top2 = result[5][1]; var content4Top3 = result[5][2]; var content4Top4 = result[5][3]; var content4Top5 = result[5][4]; var content5Top1 = result[6][0]; var content5Top2 = result[6][1]; var content5Top3 = result[6][2]; var content5Top4 = result[6][3]; var content5Top5 = result[6][4]; var teacher1Top1 = result[7][0]; var teacher1Top2 = result[7][1]; var teacher1Top3 = result[7][2]; var teacher1Top4 = result[7][3]; var teacher1Top5 = result[7][4]; var teacher2Top1 = result[8][0]; var teacher2Top2 = result[8][1]; var teacher2Top3 = result[8][2]; var teacher2Top4 = result[8][3]; var teacher2Top5 = result[8][4]; var teacher3Top1 = result[9][0]; var teacher3Top2 = result[9][1]; var teacher3Top3 = result[9][2]; var teacher3Top4 = result[9][3]; var teacher3Top5 = result[9][4]; var teacher4Top1 = result[10][0]; var teacher4Top2 = result[10][1]; var teacher4Top3 = result[10][2]; var teacher4Top4 = result[10][3]; var teacher4Top5 = result[10][4]; var teacher5Top1 = result[11][0]; var teacher5Top2 = result[11][1]; var teacher5Top3 = result[11][2]; var teacher5Top4 = result[11][3]; var teacher5Top5 = result[11][4]; var org1Top1 = result[12][0]; var org1Top2 = result[12][1]; var org1Top3 = result[12][2]; var org1Top4 = result[12][3]; var org1Top5 = result[12][4]; var org2Top1 = result[13][0]; var org2Top2 = result[13][1]; var org2Top3 = result[13][2]; var org2Top4 = result[13][3]; var org2Top5 = result[13][4]; var org3Top1 = result[14][0]; var org3Top2 = result[14][1]; var org3Top3 = result[14][2]; var org3Top4 = result[14][3]; var org3Top5 = result[14][4]; var dept = "海淀区教育党校"; var time = DateTime.Now.ToString("yyyy-MM-dd"); var str = new StringBuilder(); str.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\">"); str.Append("<head>"); str.Append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />"); str.Append("</head>"); str.Append("<body>"); str.Append("<p align=\"center\" style=\"font-size: 25px;font-weight: bold\"><strong>"); //str.Append(DateTime.Now.Year+ "年海淀区在职资格培训班培训效果测评表 "); str.Append(DateTime.Now.Year + "年中青年干部教育管理培训班课程评估表 "); str.Append("</strong><br /></p>"); str.Append("<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"614\" bordercolor=\"#000000\" bgcolor=\"#FFFFFF\" style=\"border-collapse:collapse;font-size: 14px;\" >"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"85\" align=\"center\" valign=\"middle\"><p><strong>课程名称 </strong></p></td>"); str.Append("<td width=\"217\" align=\"center\" valign=\"middle\"><p>" + courseModel.CourseName + " </p></td>"); str.Append("<td width=\"78\" colspan=\"1\" align=\"center\" valign=\"middle\"><p><strong>培训地点 </strong></p></td>"); str.Append("<td width=\"234\" colspan=\"3\" align=\"center\" valign=\"middle\"><p>" + courseModel.TeachPlace + " </p></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"85\" align=\"center\" valign=\"middle\"><p><strong>培训讲师</strong> </p></td>"); str.Append("<td width=\"217\" align=\"center\" valign=\"middle\"><p>" + courseModel.TeacherName + " </p></td>"); str.Append("<td width=\"78\" colspan=\"1\" align=\"center\" valign=\"middle\"><p><strong>培训时间 </strong></p></td>"); str.Append("<td width=\"234\" colspan=\"3\" align=\"center\" valign=\"middle\"><p>" + courseModel.TeachTime + "</p></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"85\" align=\"center\" valign=\"middle\"><p><strong>应评人数 </strong></p></td>"); str.Append("<td width=\"217\" align=\"center\" valign=\"middle\"><p>" + totalShould + "</p></td>"); str.Append("<td width=\"78\" colspan=\"1\" align=\"center\" valign=\"middle\"><p><strong>实评人数 </strong></p></td>"); str.Append("<td width=\"234\" colspan=\"3\" align=\"center\" valign=\"middle\"><p>" + totalPrac + "</p></td>"); str.Append("</tr>"); str.Append("<tr>"); str.Append("<td width=\"614\" colspan=\"6\" valign=\"left\">"); str.Append("<p align=\"center\">"); str.Append("<strong>"); str.Append(" <br />"); str.Append("</strong><strong>本次培训总体平均分:" + totalScor + "分(满分52)<br />满意度:" + satisfy + "% <br />等级:" + level + ", </strong><br />"); str.Append("<strong>其中课程内容</strong><strong>" + contenScor + "</strong><strong>分<br />培训讲师</strong><strong>" + techScor + "</strong><strong>分<br />培训组织和管理</strong><strong>" + orgScor + "</strong><strong>分</strong>"); str.Append("</p>"); str.Append("</td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"302\" colspan=\"2\" valign=\"middle\" align=\"center\"><p align=\"center\"><strong>培训满意度评价项目</strong><strong> </strong></p></td>"); // str.Append("<td width=\"78\" valign=\"middle\" align=\"center\"><p>很满意 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\" align=\"center\"><p>很满意 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\" align=\"center\"><p>满意</p></td>"); str.Append("<td width=\"78\" valign=\"middle\" align=\"center\"><p>一般</p></td>"); str.Append("<td width=\"78\" valign=\"middle\" align=\"center\"><p>不满意</p></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"302\" colspan=\"2\" valign=\"middle\" ><p align=\"center\"><strong>本次课程总体满意度 </strong></p></td>"); // str.Append("<td width=\"78\" valign=\"middle\"><p><strong>"+allTop1+"</strong></p></td>"); str.Append("<td width=\"78\" align=\"center\" valign=\"middle\"><p><strong>" + allTop2 + "</strong></p></td>"); str.Append("<td width=\"78\" align=\"center\" valign=\"middle\"><p><strong>" + allTop3 + "</strong></p></td>"); str.Append("<td width=\"78\" align=\"center\" valign=\"middle\"><p><strong>" + allTop4 + "</strong></p></td>"); str.Append("<td width=\"78\" align=\"center\" valign=\"middle\"><p><strong>" + allTop5 + "</strong></p></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"85\" rowspan=\"5\" valign=\"middle\"><p align=\"center\"><strong>课程内容</strong><strong> </strong></p></td>"); str.Append("<td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\">课程主题清晰明确 </p></td>"); // str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content1Top1 + "人</p></td>"); str.Append("<td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + content1Top2 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content1Top3 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content1Top4 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content1Top5 + "人 </p></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\">课程内容丰富、能吸引人 </p></td>"); // str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content2Top1 + "人 </p></td>"); str.Append("<td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + content2Top2 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content2Top3 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content2Top4 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content2Top5 + "人 </p></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\">课程内容切合实际,能指导实践 </p></td>"); // str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content3Top1 + "人 </p></td>"); str.Append("<td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + content3Top2 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content3Top3 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content3Top4 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content3Top5 + "人 </p></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\">课程内容重点突出,易于理解 </p></td>"); // str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content4Top1 + "人 </p></td>"); str.Append("<td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + content4Top2 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content4Top3 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content4Top4 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content4Top5 + "人 </p></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\">课程内容有助于个人发展 </p></td>"); // str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content5Top1 + "人 </p></td>"); str.Append("<td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + content5Top2 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content5Top3 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content5Top4 + "人 </p></td>"); str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + content5Top5 + "人 </p></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\">"); str.Append("<td width=\"85\" rowspan=\"5\" valign=\"middle\"><p align=\"center\"><a name=\"OLE_LINK2\" id=\"OLE_LINK2\"></a><a name=\"OLE_LINK1\" id=\"OLE_LINK1\"><strong>培训讲师</strong></a><strong> </strong></p></td>"); str.Append("<td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\"><a name=\"OLE_LINK6\" id=\"OLE_LINK6\"></a><a name=\"OLE_LINK5\" id=\"OLE_LINK5\">讲师准备比较充分</a> </p></td>"); // str.Append("<td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher1Top1 + "人 </p></td>"); str.Append(" <td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + teacher1Top2 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher1Top3 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher1Top4 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher1Top5 + "人 </p></td>"); str.Append(" </tr>"); str.Append(" <tr height=\"35\">"); str.Append(" <td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\"><a name=\"OLE_LINK8\" id=\"OLE_LINK8\"></a><a name=\"OLE_LINK7\" id=\"OLE_LINK7\">语言表达清晰,态度端正</a> </p></td>"); // str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher2Top1 + "人 </p></td>"); str.Append(" <td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + teacher2Top2 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher2Top3 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher2Top4 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher2Top5 + "人 </p></td>"); str.Append(" </tr>"); str.Append(" <tr height=\"35\">"); str.Append(" <td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\"><a name=\"OLE_LINK10\" id=\"OLE_LINK10\"></a><a name=\"OLE_LINK9\" id=\"OLE_LINK9\">仪表仪容端庄大方,有亲和力</a> </p></td>"); // str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher3Top1 + "人 </p></td>"); str.Append(" <td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + teacher3Top2 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher3Top3 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher3Top4 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher3Top5 + "人 </p></td>"); str.Append(" </tr>"); str.Append(" <tr height=\"35\">"); str.Append(" <td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\"><a name=\"OLE_LINK12\" id=\"OLE_LINK12\"></a><a name=\"OLE_LINK11\" id=\"OLE_LINK11\">培训方式多样,生动有趣</a> </p></td>"); // str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher4Top1 + "人 </p></td>"); str.Append(" <td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + teacher4Top2 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher4Top3 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher4Top4 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher4Top5 + "人 </p></td>"); str.Append(" </tr>"); str.Append(" <tr height=\"35\">"); str.Append(" <td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\"><a name=\"OLE_LINK14\" id=\"OLE_LINK14\"></a><a name=\"OLE_LINK13\" id=\"OLE_LINK13\">与学员沟通和互动有效</a> </p></td>"); // str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher5Top1 + "人 </p></td>"); str.Append(" <td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + teacher5Top2 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher5Top3 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher5Top4 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + teacher5Top5 + "人 </p></td>"); str.Append(" </tr>"); str.Append(" <tr height=\"35\">"); str.Append(" <td width=\"85\" rowspan=\"3\" valign=\"middle\"><p align=\"center\"><a name=\"OLE_LINK4\" id=\"OLE_LINK4\"></a><a name=\"OLE_LINK3\" id=\"OLE_LINK3\"><strong>培训组织和管理</strong></a><strong> </strong></p></td>"); str.Append(" <td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\"><a name=\"OLE_LINK16\" id=\"OLE_LINK16\"></a><a name=\"OLE_LINK15\" id=\"OLE_LINK15\">培训服务周到细致</a> </p></td>"); // str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + org1Top1 + "人 </p></td>"); str.Append(" <td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + org1Top2 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + org1Top3 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + org1Top4 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + org1Top5 + "人 </p></td>"); str.Append(" </tr>"); str.Append(" <tr height=\"35\">"); str.Append(" <td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\"><a name=\"OLE_LINK18\" id=\"OLE_LINK18\"></a><a name=\"OLE_LINK17\" id=\"OLE_LINK17\">培训时间安排和控制合理</a> </p></td>"); // str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + org2Top1 + "人 </p></td>"); str.Append(" <td width=\"78\" align=\"center\" valign=\"middle\"><p align=\"center\">" + org2Top2 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + org2Top3 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + org2Top4 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\"><p align=\"center\">" + org2Top5 + "人 </p></td>"); str.Append(" </tr>"); str.Append(" <tr height=\"35\">"); str.Append(" <td width=\"217\" valign=\"middle\"><p style=\"margin-left: 3px;\"><a name=\"OLE_LINK20\" id=\"OLE_LINK20\"></a><a name=\"OLE_LINK19\" id=\"OLE_LINK19\">培训场所、设备安排到位</a> </p></td>"); // str.Append(" <td width=\"78\" valign=\"middle\"><p>" + org3Top1 + "人 </p></td>"); str.Append(" <td width=\"78\" align=\"center\" valign=\"middle\"><p>" + org3Top2 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\" align=\"center\" ><p>" + org3Top3 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\" align=\"center\" ><p>" + org3Top4 + "人 </p></td>"); str.Append(" <td width=\"78\" valign=\"middle\" align=\"center\" ><p>" + org3Top5 + "人 </p></td>"); str.Append(" </tr>"); str.Append(" <tr height=\"35\">"); str.Append(" <td width=\"85\" valign=\"middle\" align=\"center\"><p><a name=\"_Hlk401413534\" id=\"_Hlk401413534\"><strong>测评单位 </strong></a></p></td>"); str.Append(" <td width=\"217\" valign=\"middle\" align=\"center\"><p>" + dept + " </p></td>"); str.Append(" <td width=\"78\" colspan=\"1\" align=\"center\" valign=\"middle\"><p><strong>测评时间 </strong></p></td>"); str.Append(" <td width=\"234\" colspan=\"3\" align=\"center\" valign=\"middle\"><p>" + time + "</p></td>"); str.Append(" </tr>"); str.Append("</table>"); str.Append("</body>"); str.Append("</html>"); return str.ToString(); }
void GenerateEvReportData(Guid courseId) { ISheet sheet1 = hssfworkbook.CreateSheet("评估报告单"); ICellStyle cellstyleHead = hssfworkbook.CreateCellStyle(); cellstyleHead.VerticalAlignment = VerticalAlignment.Center; //表头样式 cellstyleHead.BorderBottom = BorderStyle.Thin; cellstyleHead.BorderLeft = BorderStyle.Thin; cellstyleHead.BorderRight = BorderStyle.Thin; cellstyleHead.BorderTop = BorderStyle.Thin; cellstyleHead.WrapText = true; cellstyleHead.Alignment= HorizontalAlignment.Center; var font = hssfworkbook.CreateFont(); font.FontHeightInPoints = 15; font.FontName = "宋体"; font.Boldweight = 700; cellstyleHead.SetFont(font); //表体样式 ICellStyle cellstyleContent = hssfworkbook.CreateCellStyle(); cellstyleContent.BorderBottom = BorderStyle.Thin; cellstyleContent.BorderLeft = BorderStyle.Thin; cellstyleContent.BorderRight = BorderStyle.Thin; cellstyleContent.BorderTop = BorderStyle.Thin; cellstyleContent.Alignment = HorizontalAlignment.Center; var font1 = hssfworkbook.CreateFont(); font1.FontHeightInPoints = 14; font1.FontName = "宋体"; font1.Boldweight = 10; cellstyleContent.SetFont(font1); cellstyleContent.WrapText = true; ICellStyle cellstyleConTitle = hssfworkbook.CreateCellStyle(); cellstyleConTitle.BorderBottom = BorderStyle.Thin; cellstyleConTitle.BorderLeft = BorderStyle.Thin; cellstyleConTitle.BorderRight = BorderStyle.Thin; cellstyleConTitle.BorderTop = BorderStyle.Thin; cellstyleConTitle.Alignment = HorizontalAlignment.Center; cellstyleConTitle.VerticalAlignment = VerticalAlignment.Center; var font11 = hssfworkbook.CreateFont(); font11.FontHeightInPoints = 14; font11.FontName = "宋体"; font11.Boldweight = 600; cellstyleConTitle.SetFont(font11); cellstyleConTitle.WrapText = true; ICellStyle cellstyleConTitleLeft = hssfworkbook.CreateCellStyle(); cellstyleConTitleLeft.BorderBottom = BorderStyle.Thin; cellstyleConTitleLeft.BorderLeft = BorderStyle.Thin; cellstyleConTitleLeft.BorderRight = BorderStyle.Thin; cellstyleConTitleLeft.BorderTop = BorderStyle.Thin; cellstyleConTitleLeft.Alignment = HorizontalAlignment.Left; cellstyleConTitleLeft.VerticalAlignment = VerticalAlignment.Center; var fontTitleLeft = hssfworkbook.CreateFont(); fontTitleLeft.FontHeightInPoints = 14; fontTitleLeft.FontName = "宋体"; fontTitleLeft.Boldweight = 10; cellstyleConTitleLeft.SetFont(fontTitleLeft); cellstyleConTitleLeft.WrapText = true; IRow title = sheet1.CreateRow(0); title.Height = 600; for (int f = 0; f < 6; f++) { ICell cell = title.CreateCell(f); sheet1.SetColumnWidth(f, 13 * 256); cell.SetCellValue(DateTime.Now.Year+ "年中青年干部教育管理培训班课程评估表"); cell.CellStyle = cellstyleHead; } SetCellRangeAddress(sheet1, 0, 0, 0, 5); sheet1.SetColumnWidth(0, 15 * 256); sheet1.SetColumnWidth(1, 25 * 256); sheet1.SetColumnWidth(2, 15 * 256); sheet1.SetColumnWidth(3, 15 * 256); sheet1.SetColumnWidth(4, 15 * 256); sheet1.SetColumnWidth(5, 15 * 256); var coubll= new BLL.Course(); var couModel = coubll.GetModel(courseId); var question = new BLL.Questionnaire(); var exportDs = question.GetReportTile(courseId); if (exportDs != null && exportDs.Tables.Count > 0&&exportDs.Tables[0].Rows.Count>0) { var datarow = exportDs.Tables[0].Rows[0]; IRow row1 = sheet1.CreateRow(1); ICell cell1 = row1.CreateCell(0); cell1.CellStyle = cellstyleConTitle; cell1.SetCellValue("课程名称"); ICell cell2 = row1.CreateCell(1); cell2.CellStyle = cellstyleContent; cell2.SetCellValue( couModel.CourseName); ICell cell3 = row1.CreateCell(2); cell3.CellStyle = cellstyleConTitle; cell3.SetCellValue("培训地点"); ICell cell4 = row1.CreateCell(3); cell4.CellStyle = cellstyleContent; cell4.SetCellValue(couModel.TeachPlace); ICell cell5 = row1.CreateCell(4); cell5.CellStyle = cellstyleContent; cell5.SetCellValue(couModel.TeachPlace); ICell cell6 = row1.CreateCell(5); cell6.CellStyle = cellstyleContent; cell6.SetCellValue(couModel.TeachPlace); SetCellRangeAddress(sheet1, 1, 1, 3, 5); IRow row2 = sheet1.CreateRow(2); ICell cell21 = row2.CreateCell(0); cell21.CellStyle = cellstyleConTitle; cell21.SetCellValue("培训讲师"); ICell cell22 = row2.CreateCell(1); cell22.CellStyle = cellstyleContent; cell22.SetCellValue( couModel.TeacherName); ICell cell23 = row2.CreateCell(2); cell23.CellStyle = cellstyleConTitle; cell23.SetCellValue("培训时间"); ICell cell24 = row2.CreateCell(3); cell24.CellStyle = cellstyleContent; cell24.SetCellValue(couModel.TeachTime); ICell cell25 = row2.CreateCell(4); cell25.CellStyle = cellstyleContent; cell25.SetCellValue(couModel.TeachTime); ICell cell26 = row2.CreateCell(5); cell26.CellStyle = cellstyleContent; cell26.SetCellValue(couModel.TeachTime); SetCellRangeAddress(sheet1, 2, 2, 3, 5); IRow row3 = sheet1.CreateRow(3); ICell cell31 = row3.CreateCell(0); cell31.CellStyle = cellstyleConTitle; cell31.SetCellValue("应评人数"); ICell cell32 = row3.CreateCell(1); cell32.CellStyle = cellstyleContent; cell32.SetCellValue(datarow["totalNum"].ToString()+"人"); ICell cell33 = row3.CreateCell(2); cell33.CellStyle = cellstyleConTitle; cell33.SetCellValue("实评人数"); ICell cell34 = row3.CreateCell(3); cell34.CellStyle = cellstyleContent; cell34.SetCellValue(datarow["totalDone"].ToString() + "人"); ICell cell35 = row3.CreateCell(4); cell35.CellStyle = cellstyleContent; cell35.SetCellValue(datarow["totalDone"].ToString() + "人"); ICell cell36 = row3.CreateCell(5); cell36.CellStyle = cellstyleContent; cell36.SetCellValue(datarow["totalDone"].ToString() + "人"); SetCellRangeAddress(sheet1, 3, 3, 3, 5); IRow row4 = sheet1.CreateRow(4); ICell cell41 = row4.CreateCell(0); cell41.CellStyle = cellstyleConTitle; cell41.SetCellValue("总体平均分"); ICell cell42 = row4.CreateCell(1); cell42.CellStyle = cellstyleContent; cell42.SetCellValue(string.Format("{0:N2}", datarow["totalAvg"]) + " 分(满分52)"); ICell cell43 = row4.CreateCell(2); cell43.CellStyle = cellstyleConTitle; cell43.SetCellValue("满意度"); ICell cell44 = row4.CreateCell(3); cell44.CellStyle = cellstyleContent; cell44.SetCellValue(Convert.ToDouble(datarow["Satisfy"]) >= 1.0 ? "100%" : string.Format("{0:N2}" + "%", ((Convert.ToDecimal(datarow["Satisfy"])) * 100))); ICell cell45 = row4.CreateCell(4); cell45.CellStyle = cellstyleConTitle; cell45.SetCellValue("等级"); ICell cell46 = row4.CreateCell(5); cell46.CellStyle = cellstyleContent; cell46.SetCellValue(question.GetLevel(Convert.ToDouble(datarow["Satisfy"]))); SetCellRangeAddress(sheet1, 4, 4, 3, 5); var resultTotalReport = question.GetTotalReport(); if (resultTotalReport != null && resultTotalReport.Rows.Count > 0) { var cr = resultTotalReport.Select(string.Format(" CourseId='{0}'", courseId)); if (cr.Length > 0) { IRow row5 = sheet1.CreateRow(5); ICell cell51 = row5.CreateCell(0); cell51.CellStyle = cellstyleConTitle; cell51.SetCellValue("课程内容"); ICell cell52 = row5.CreateCell(1); cell52.CellStyle = cellstyleContent; // cell52.SetCellValue(cr[0]["TotalCourse"].ToString()); cell52.SetCellValue(Convert.ToDouble(cr[0]["TotalCourse"]) >= 1.0 ? "100%" : string.Format("{0:N2}" + "%", ((Convert.ToDecimal(cr[0]["TotalCourse"])) * 100))); ICell cell53 = row5.CreateCell(2); cell53.CellStyle = cellstyleConTitle; cell53.SetCellValue("培训讲师"); ICell cell54 = row5.CreateCell(3); cell54.CellStyle = cellstyleContent; // cell54.SetCellValue(cr[0]["TotalTeacher"].ToString()); cell54.SetCellValue(Convert.ToDouble(cr[0]["TotalTeacher"]) >= 1.0 ? "100%" : string.Format("{0:N2}" + "%", ((Convert.ToDecimal(cr[0]["TotalTeacher"])) * 100))); ICell cell55 = row5.CreateCell(4); cell55.CellStyle = cellstyleConTitle; cell55.SetCellValue("培组织管理"); ICell cell56 = row5.CreateCell(5); cell56.CellStyle = cellstyleContent; // cell56.SetCellValue(cr[0]["TotalOrg"].ToString()); cell56.SetCellValue(Convert.ToDouble(cr[0]["TotalOrg"]) >= 1.0 ? "100%" : string.Format("{0:N2}" + "%", ((Convert.ToDecimal(cr[0]["TotalOrg"])) * 100))); } } var reportBody = question.GetReport(courseId); if (reportBody != null && reportBody.Tables.Count > 0) { var result = new Dictionary<int, double[]>(); if (reportBody != null && reportBody.Tables.Count > 0) { foreach (DataRow row in reportBody.Tables[0].Rows) { result.Add((int)row["num"], new[] { Convert.ToDouble(row["top1"]), Convert.ToDouble(row["top2"]), Convert.ToDouble(row["top3"]), Convert.ToDouble(row["top4"]), Convert.ToDouble(row["top5"]) }); } } var allTop1 = string.Format("{0:N2}" + "%", result[1][0] * 100); var allTop2 = string.Format("{0:N2}" + "%", result[1][1] * 100); var allTop3 = string.Format("{0:N2}" + "%", result[1][2] * 100); var allTop4 = string.Format("{0:N2}" + "%", result[1][3] * 100); var allTop5 = string.Format("{0:N2}" + "%", result[1][4] * 100); IRow row6 = sheet1.CreateRow(6); ICell cell61 = row6.CreateCell(0); cell61.CellStyle = cellstyleConTitle; cell61.SetCellValue("培训满意度评价项目"); ICell cell62 = row6.CreateCell(1); cell62.CellStyle = cellstyleConTitle; cell62.SetCellValue("培训满意度评价项目"); ICell cell63 = row6.CreateCell(2); cell63.CellStyle = cellstyleContent; cell63.SetCellValue("很满意"); ICell cell64 = row6.CreateCell(3); cell64.CellStyle = cellstyleContent; cell64.SetCellValue("满意"); ICell cell65 = row6.CreateCell(4); cell65.CellStyle = cellstyleContent; cell65.SetCellValue("一般"); ICell cell66 = row6.CreateCell(5); cell66.CellStyle = cellstyleContent; cell66.SetCellValue("不满意"); SetCellRangeAddress(sheet1, 6, 6, 0, 1); IRow row7 = sheet1.CreateRow(7); ICell cell71 = row7.CreateCell(0); cell71.CellStyle = cellstyleConTitle; cell71.SetCellValue("本次课程总体满意度"); ICell cell72 = row7.CreateCell(1); cell72.CellStyle = cellstyleConTitle; cell72.SetCellValue("本次课程总体满意度"); ICell cell73 = row7.CreateCell(2); cell73.CellStyle = cellstyleContent; cell73.SetCellValue(allTop2); ICell cell74 = row7.CreateCell(3); cell74.CellStyle = cellstyleContent; cell74.SetCellValue(allTop3); ICell cell75 = row7.CreateCell(4); cell75.CellStyle = cellstyleContent; cell75.SetCellValue(allTop4); ICell cell76 = row7.CreateCell(5); cell76.CellStyle = cellstyleContent; cell76.SetCellValue(allTop5); SetCellRangeAddress(sheet1, 7, 7, 0, 1); var startRowNum = 8; var startKey = 2; SetDetailValue("课程内容", new []{"课程主题清晰明确","课程内容丰富、能吸引人","课程内容切合实际,能指导实践","课程内容重点突出,易于理解","课程内容有助于个人发展"}, result, ref startRowNum, sheet1, cellstyleContent, cellstyleConTitle, ref startKey, cellstyleConTitleLeft); SetDetailValue("培训讲师", new[] { "讲师准备比较充分", "语言表达清晰,态度端正", "仪表仪容端庄大方,有亲和力", "培训方式多样,生动有趣", "与学员沟通和互动有效" }, result, ref startRowNum, sheet1, cellstyleContent, cellstyleConTitle, ref startKey, cellstyleConTitleLeft); SetDetailValue("培训组织和管理", new[] { "培训服务周到细致", "培训时间安排和控制合理", "培训场所、设备安排到位" }, result, ref startRowNum, sheet1, cellstyleContent, cellstyleConTitle, ref startKey, cellstyleConTitleLeft); IRow endrow = sheet1.CreateRow(startRowNum); ICell endcell1 = endrow.CreateCell(0); endcell1.CellStyle = cellstyleConTitle; endcell1.SetCellValue("测评单位"); ICell endcell12 = endrow.CreateCell(1); endcell12.CellStyle = cellstyleContent; endcell12.SetCellValue("海淀区教育党校"); ICell endcell13 = endrow.CreateCell(2); endcell13.CellStyle = cellstyleConTitle; endcell13.SetCellValue("测评时间"); ICell endcell14 = endrow.CreateCell(3); endcell14.CellStyle = cellstyleContent; endcell14.SetCellValue(DateTime.Now.ToString("yyyy-MM-dd")); ICell endcell15 = endrow.CreateCell(4); endcell15.CellStyle = cellstyleContent; endcell15.SetCellValue(DateTime.Now.ToString("yyyy-MM-dd")); ICell endcell16 = endrow.CreateCell(5); endcell16.CellStyle = cellstyleContent; endcell16.SetCellValue(DateTime.Now.ToString("yyyy-MM-dd")); SetCellRangeAddress(sheet1, startRowNum, startRowNum, 3, 5); } } GetSuggestion(courseId.ToString()); }