123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using Bowin.Common.Data;
- using Bowin.Common.Utility;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.ProjectShareManage;
- using EMIS.ViewModel;
- using EMIS.ViewModel.ProjectShareManage;
- using EMIS.Web.Controls;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace EMIS.Web.Controllers.ProjectShareManage
- {
- public class ShareRecordController : Controller
- {
- public IShareRecordServices shareRecordServices { get; set; }
- /// <summary>
- /// 项目资讯页面
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var startTime = pararms.getExtraDateTime("StartTime");
- var endTime = pararms.getExtraDateTime("EndTime");
- var title = pararms.getExtraString("Title");
- var userID = pararms.getExtraGuid("StudentsComboGrid");
- return base.Json(shareRecordServices.GetShareRecordViewGrid(configuretView, startTime, endTime, title, userID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView conditionView = ConfiguretExtensions.GetConfiguretermsView(null);
- var startTime = Request.Form["StartTime"].ParseStrTo<DateTime>();
- var endTime = Request.Form["EndTime"].ParseStrTo<DateTime>();
- var title = Request.Form["Title"].ToString();
- var userID = Request.Form["StudentsComboGrid"].ParseStrTo<Guid>();
- var shareRecordIDs = Request.Form["selectedIDs"].Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- var dt = shareRecordServices.GetShareRecordViewList(conditionView, startTime, endTime, title, userID, shareRecordIDs).Select(x => new
- {
- x.YearMonthDay,
- x.Time,
- x.Title,
- x.UserName,
- x.ClassmajorName,
- x.Count,
- }).ToTable();
- string[] liststring = { "年月日", "时间", "文章标题", "分享人", "班级", "积分" };
- neh.Export(dt, liststring, "分享信息" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- [HttpGet]
- public ActionResult GetCodeBack()
- {
- var headers = HttpContext.Request;
- return View();
- }
- }
- }
|