Ejemplo n.º 1
0
        /// <summary>
        /// 导出发票信息
        /// </summary>
        /// <param name="stDate"></param>
        /// <param name="edDate"></param>
        /// <returns></returns>
        public ActionResult ExportOrder(DateTime stDate, DateTime edDate)
        {
            ManageUserModel uM  = (ManageUserModel)Session["logUser"];
            int             uid = uM.UserID;

            List <dynamic> ds = T_Order_InvoiceBLL.GetExportInvoice(stDate, edDate);

            Dictionary <string, string> colName = new Dictionary <string, string>();

            colName["ID"]              = "店铺ID";
            colName["CompanyName"]     = "店铺名称";
            colName["invoiceMoney"]    = "发票金额";
            colName["transactionDate"] = "订单日期";
            colName["invoiceName"]     = "发票抬头";
            colName["invoicePhone"]    = "手机号码";
            colName["invoiceAddress"]  = "发票地址";
            colName["UserRealName"]    = "收件人姓名";
            colName["invoice_zip"]     = "邮政编码";

            HelperEx.ExportExcel export = new HelperEx.ExportExcel("发票信息", "invoice", colName);
            string webPath     = System.Web.HttpContext.Current.Server.MapPath("/");
            string strFileName = export.ExportFile(uM.UserName, ds, webPath);

            ViewBag.NavigateUrl = strFileName;

            Response.Redirect(strFileName);
            return(View());
        }
        public ActionResult Download(string verif)
        {
            string          verification = verif;
            ManageUserModel uM           = (ManageUserModel)Session["logUser"];
            int             uid          = uM.UserID;

            string UidList = Controls.Filtrate.Filtrate.GetAccountList(uid, verification);


            //string TopList = UidList.Substring(0, index);

            int    starting = -1;
            int    finish   = 0;
            int    size     = 0;
            string nowStr   = "";
            string itemList = "";

            while (size <= 100)
            {
                starting = UidList.IndexOf(',', finish);
                if (starting > -1)
                {
                    finish = UidList.IndexOf(',', starting + 1);
                    if (finish > 0)
                    {
                        nowStr = UidList.Substring(starting + 1, finish - starting - 1);
                    }
                    else
                    {
                        nowStr = UidList.Substring(starting + 1);
                        finish = starting + nowStr.Length + 1;
                    }
                    if (nowStr != null && nowStr != "")
                    {
                        if (size > 0)
                        {
                            itemList += ",";
                        }
                        itemList += "" + nowStr;
                        size++;
                    }
                }
                else
                {
                    break;
                }
            }
            List <dynamic> ds = Controls.Filtrate.Filtrate.GetSummarizingData(itemList);

            Dictionary <string, string> colName = new Dictionary <string, string>();

            colName["ID"]               = "店铺ID";
            colName["CompanyName"]      = "店铺名称";
            colName["UserRealName"]     = "店主名称";
            colName["PhoneNumber"]      = "电话号码";
            colName["UserEmail"]        = "电子邮件";
            colName["RegTime"]          = "注册时间";
            colName["aotjb"]            = "版本";
            colName["aotjbEndtime"]     = "版本结束时间";
            colName["userNum"]          = "会员数";
            colName["goodsNum"]         = "商品名称";
            colName["saleNum"]          = "销售数";
            colName["smsNum"]           = "发送短信数";
            colName["dxunity"]          = "剩余短信数";
            colName["outlayNum"]        = "支出数";
            colName["returnInsertTime"] = "最后回访人";
            colName["allCount"]         = "总优惠券";
            colName["userCount"]        = "使用优惠券";
            colName["LoginTimeWeb"]     = "登录次数";
            colName["LoginTimeLast"]    = "最后登录时间";
            colName["active"]           = "活跃状态";
            colName["orderMoney"]       = "订单金额";
            colName["AgentName"]        = "代理商";



            HelperEx.ExportExcel export = new HelperEx.ExportExcel("筛选数据", "synthesie", colName);
            string webPath     = System.Web.HttpContext.Current.Server.MapPath("/");
            string strFileName = export.ExportFile(uM.UserName, ds, webPath);


            ViewBag.NavigateUrl = strFileName;

            Response.Redirect(strFileName);
            return(View());
        }