示例#1
0
        public ActionResult ExportExcelToDownLoad(string excelName = "测试")
        {
            ExtentionComplainBag cbag = new ExtentionComplainBag();
            ComplainParam pra = new ComplainParam();
            pra.seltime = DateTime.Now;
            pra.selline = "";
            pra.selkeywords = "";

            cbag = new Admin_ExcelResourceForComplainLogic().GetAnalysisByComplain(this.pageSize, this.page, out this.totalCount, pra);

            string filename = excelName + ".xls";
            Response.ContentType = "application/vnd.ms-excel";
            Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", filename));
            Response.Clear();

            HSSFWorkbook hssfworkbook = new HSSFWorkbook();
            InitializeWorkbook(hssfworkbook);
            GenerateData(hssfworkbook, cbag.list);
            GetExcelStream(hssfworkbook).WriteTo(Response.OutputStream);
            Response.End();
            return new EmptyResult();
        }
示例#2
0
 public ActionResult ComplainAnalysis(FormCollection form)
 {
     this.pageSize = GetPageSize(1000); //每页数量,此查询显示暂不分页,预留1000行
     ExtentionCbag result = new Admin_ExcelResourceForComplainLogic().GetGroupByCPAnalysis(this.pageSize, this.page, out this.totalCount, DateTime.Now);
     return View(result);
 }
示例#3
0
        public ActionResult ComplainManage(FormCollection form)
        {
            ExtentionComplainBag cbag = new ExtentionComplainBag();
            if (form.Count != 0 || Request.QueryString.Count != 0)//有选择条件
            {
                ComplainParam pra = new ComplainParam();
                //post请求
                if (Request.HttpMethod.Equals("POST", StringComparison.OrdinalIgnoreCase))
                {
                    if (form["SelTime"] != "" && form["SelTime"] != null)
                    {
                        pra.seltime = Convert.ToDateTime(form["SelTime"]);
                    }
                    else
                    {
                        pra.seltime = DateTime.Now.AddDays(-1);
                    }
                }
                else if (DTRequest.GetQueryString("seltime") != "")
                {
                    pra.seltime = Convert.ToDateTime(DTRequest.GetQueryString("seltime"));
                }
                else
                {
                    pra.seltime = DateTime.Now.AddDays(-1);
                }

                //post请求
                if (Request.HttpMethod.Equals("POST", StringComparison.OrdinalIgnoreCase))
                {
                    if (form["SelLine"] != "" && form["SelLine"] != null)
                    {
                        pra.selline = form["SelLine"];
                    }
                    else
                    {
                        pra.selline = "";
                    }
                }
                else if (DTRequest.GetQueryString("SelLine") != "")
                {
                    pra.selline = DTRequest.GetQueryString("SelLine");
                }
                else
                {
                    pra.selline = "";
                }

                //post请求
                if (Request.HttpMethod.Equals("POST", StringComparison.OrdinalIgnoreCase))
                {
                    if (form["SelKeywords"] != "" && form["SelKeywords"] != null)
                    {
                        pra.selkeywords = form["SelKeywords"];
                    }
                    else
                    {
                        pra.selkeywords = "";
                    }
                }
                else if (DTRequest.GetQueryString("SelKeywords") != "")
                {
                    pra.selkeywords = DTRequest.GetQueryString("SelKeywords");
                }
                else
                {
                    pra.selkeywords = "";
                }

                this.pageSize = GetPageSize(20); //每页数量
                this.page = DTRequest.GetQueryInt("page", 1);
                ViewBag.txtKeywords = this.keywords;
                cbag = new Admin_ExcelResourceForComplainLogic().GetAnalysisByComplain(this.pageSize, this.page, out this.totalCount, pra);
                //绑定页码
                ViewBag.txtPageNum = this.pageSize.ToString();
                string pageUrl = Utils.CombUrlTxt("../admin/ComplainManage", "seltime={0}&selline={1}&selkeywords={2}&page={3}", pra.seltime.ToString(), pra.selline, pra.selkeywords, "__id__");
                ViewBag.PageContent = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
                return View(cbag);
            }
            else
            {
                ComplainParam pra = new ComplainParam();
                pra.seltime = DateTime.Now.AddDays(-1);
                pra.selline = "";
                pra.selkeywords = "";

                this.pageSize = GetPageSize(20); //每页数量
                //post请求,点击查询返回第一页
                if (Request.HttpMethod.Equals("POST", StringComparison.OrdinalIgnoreCase))
                {
                    this.page = 1;
                }
                else
                {
                    this.page = DTRequest.GetQueryInt("page", 1);
                }
                ViewBag.txtKeywords = this.keywords;
                cbag = new Admin_ExcelResourceForComplainLogic().GetAnalysisByComplain(this.pageSize, this.page, out this.totalCount, pra);
                //绑定页码
                ViewBag.txtPageNum = this.pageSize.ToString();
                string pageUrl = Utils.CombUrlTxt("../admin/ComplainManage", "seltime={0}&selline={1}&selkeywords={2}&page={3}", pra.seltime.ToString(), pra.selline, pra.selkeywords, "__id__");
                ViewBag.PageContent = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
                return View(cbag);
            }
        }
示例#4
0
 public ActionResult ChannelComplainManage(FormCollection form)
 {
     ChannelComplainParam pra = new ChannelComplainParam();
     if (form.Count > 0)
     {
         if (form["SelTime"] != "" && form["SelTime"] != null)
         {
             //pra.selmonth = Convert.ToDateTime(form["SelTime"] + "-01");
         }
         else
         {
             //pra.selmonth = DateTime.Now;
         }
         pra.opusName = form["SelOpusName"];
     }
     ExtentionChannelComplainAnalysis result = new Admin_ExcelResourceForComplainLogic().GetChannelAnalysisComplain(this.pageSize, this.page, out this.totalCount, pra);
     return View();
 }