Пример #1
0
        public ActionResult DownloadWord()
        {
            XWPFDocument doc = RollExcelManager.SaveWord(Core.RollViewManager.GetRollList(BREnum.Black, null, true));
            MemoryStream ms  = new MemoryStream();

            doc.Write(ms);
            ms.Flush();
            byte[] fileContents = ms.ToArray();
            return(File(fileContents, "application/octet-stream", "黑名单公告.docx"));
        }
Пример #2
0
        public ActionResult DownloadBook(Letter letter)
        {
            XWPFDocument doc = RollExcelManager.SaveWord(letter);
            MemoryStream ms  = new MemoryStream();

            doc.Write(ms);
            ms.Flush();
            byte[] fileContents = ms.ToArray();
            return(File(fileContents, "application/octet-stream", string.Format("{0}-{1}.docx", letter.Name, letter.Book.GetDescription())));
        }
Пример #3
0
        public ActionResult DownLoad(BREnum brenum, string key)
        {
            var          list     = Core.RollViewManager.GetRollList(brenum, key);
            IWorkbook    workbook = RollExcelManager.SaveRoll(list);
            MemoryStream ms       = new MemoryStream();

            workbook.Write(ms);
            ms.Flush();
            byte[] fileContents = ms.ToArray();
            return(File(fileContents, "application/ms-excel", string.Format("诚信系统{0}名单列表.xls", brenum == BREnum.Black?"黑":"异常")));
        }
        public ActionResult Download(GradeDegree?degree = null)
        {
            var enterprise = Core.ScoreManager.GetEnterprise();
            var lawyers    = Core.ScoreManager.GetLawyer();

            if (degree.HasValue)
            {
                enterprise = enterprise.Where(e => e.Degree == degree.Value).ToList();
                lawyers    = lawyers.Where(e => e.Degree == degree.Value).ToList();
            }
            IWorkbook    workbook = RollExcelManager.SaveScore(enterprise, lawyers);
            MemoryStream ms       = new MemoryStream();

            workbook.Write(ms);
            ms.Flush();
            byte[] fileContents = ms.ToArray();
            return(File(fileContents, "application/ms-excel", "综合分值表.xls"));
        }