Ejemplo n.º 1
0
        public ActionResult ExportAll()
        {
            QueryParam queryParam = new QueryParam();

            var extendParams = Request.Params["extendParams"];

            if (extendParams != null)
            {
                JavaScriptSerializer             js        = new JavaScriptSerializer();
                List <FilterModel>               filters   = js.Deserialize <List <FilterModel> >(extendParams);
                Dictionary <string, FilterModel> filterSet = filters.ToDictionary(key => key.key, model => model);

                queryParam.filters = filterSet;
            }


            OperateResult or = AssessmentManager.ExportAll(queryParam);

            if (or.status == OperateStatus.Success &&
                or.data != null)
            {
                string exportFileName = string.Concat("导出", DateTime.Now.ToString("yyyyMMddHHmmss"), ".xlsx");

                return(new ExportExcelResult
                {
                    SheetName = "考核记录",
                    FileName = exportFileName,
                    ExportData = (DataTable)or.data
                });
            }

            return(Json(or, JsonRequestBehavior.AllowGet));
        }