123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Common.Data;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.EvaluationManage;
- using Bowin.Common.Utility;
- namespace EMIS.Web.Controllers.EvaluationManage.EvaluationReport
- {
- [Authorization]
- public class SatisfyRateReportController : Controller
- {
- public ISatisfyRateServices SatisfyRateServices { get; set; }
- public ActionResult Index()
- {
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var collegeID = pararms.getExtraGuid("cbgCollege");
- var evaluationTypeID = pararms.getExtraGuid("ddlEvaluationType");
- var teacherTypeID = pararms.getExtraInt("ddlTeacherType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlTeacherType");
- var result = SatisfyRateServices.GetSatisfyRateViewList(configuretView, evaluationTypeID, collegeID, teacherTypeID, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var collegeID = Request.Form["cbgCollege"].ParseStrTo<Guid>();
- var evaluationTypeID = Request.Form["ddlEvaluationType"].ParseStrTo<Guid>();
- var teacherTypeID = Request.Form["ddlTeacherType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlTeacherType"].ParseStrTo<int>();
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- var dt = SatisfyRateServices.GetSatisfyRateViewList(configuretView, evaluationTypeID, collegeID, teacherTypeID).Select(x => new
- {
- x.LoginID,
- x.Name,
- x.TeacherTypeDesc,
- x.CollegeName,
- SatisfyRate = string.Format("{0:#.0}", x.SatisfyRate)
- }).ToTable();
- string[] liststring = { "教师工号", "教师姓名", "教师类型", "所在教学点", "满意率" };
- neh.Export(dt, liststring, "教师满意率信息");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功。",
- url = Url.Content("~/SatisfyRateReport/Index").AddMenuParameter()
- });
- }
- }
- }
|