Exemple #1
0
        /// <summary>
        /// 导出付款条款
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public ActionResult ExportPayment(PaymentSearchDTO dto)
        {
            string result = null;

            List <PaymentResultDTO> pp = null;

            pp = BaseInfoProvider.GetPaymentList(dto);

            string        strTemplateFile = Server.MapPath(@"~/TempLate/PaymentTemplate.xlsx");
            string        strGenarateDir  = Server.MapPath(@"~/TempFile");
            string        strGenarateFile = Guid.NewGuid().ToString("N") + ".xlsx";
            string        strExportFile   = strGenarateDir + "\\" + strGenarateFile;
            List <object> ratelist        = new List <object>();

            pp.ForEach(g =>
            {
                Models.Model.Excel.ExcelPayment er = new Models.Model.Excel.ExcelPayment();
                er.状态         = g.PayStatusStr;
                er.付款条款       = g.PayName;
                er.OracleName = g.OracleName;
                er.开始日期       = g.PayStartTime.HasValue ? g.PayStartTime.Value.ToString("yyyy-MM-dd") : null;
                er.结束日期       = g.PayEndTime.HasValue ? g.PayEndTime.Value.ToString("yyyy-MM-dd") : null;
                ratelist.Add(er);
            });

            if (Common.ExcelHelper.Export(strTemplateFile, strGenarateDir, strGenarateFile, ratelist, "Sheet1"))
            {
                result = strGenarateFile;
            }

            return(Json(result));
        }
Exemple #2
0
        /// <summary>
        /// 查询付款条款信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public ActionResult GetPaymentList(PaymentSearchDTO dto)
        {
            List <PaymentResultDTO> result = null;

            result = BaseInfoProvider.GetPaymentList(dto);

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