Esempio n. 1
0
        /// <summary>
        /// 获取导出的Excel数据
        /// </summary>
        public List <InvoiceExportDTO> GetInvoiceExportExt(InvoiceExportDTO search)
        {
            var query = from t1 in Invoice.ObjectSet()
                        join t2 in CommodityOrder.ObjectSet()
                        on t1.CommodityOrderId equals t2.Id
                        join t3 in OrderItem.ObjectSet()
                        on t1.CommodityOrderId equals t3.CommodityOrderId
                        select new
            {
                t2.AppId, t1.State, t1.InvoiceType, t1.SubTime, t1.InvoiceTitle, t3.Name, t2.RealPrice, t2.Code
            };

            if (search.AppId != Guid.Empty)
            {
                query = query.Where(p => p.AppId == search.AppId);
            }
            if (search.StartTime.ToString() != "0001/1/1 0:00:00" && search.EndTime.ToString() != "0001/1/1 0:00:00")
            {
                query = query.Where(p => (p.SubTime >= search.StartTime && p.SubTime <= search.EndTime));
            }
            if (search.InvoiceState != 0)
            {
                query = query.Where(p => p.State == search.InvoiceState);
            }
            if (search.InvoiceType != 0)
            {
                query = query.Where(p => p.InvoiceType == search.InvoiceType);
            }
            List <InvoiceExportDTO> objlist = new List <InvoiceExportDTO>();

            foreach (var item in query.ToList())
            {
                InvoiceExportDTO model = new InvoiceExportDTO();
                model.Year         = int.Parse(item.SubTime.Year.ToString());
                model.Month        = int.Parse(item.SubTime.Month.ToString());
                model.SubTime      = DateTime.Parse(item.SubTime.ToString("yyyy-MM-dd"));
                model.InvoiceTitle = item.InvoiceTitle;
                model.Content      = item.Name;
                model.RealPrice    = item.RealPrice;
                model.Code         = item.Code;
                objlist.Add(model);
            }
            return(objlist);
        }
Esempio n. 2
0
        /// 导出发票信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List <InvoiceExportDTO> GetInvoiceExport(InvoiceExportDTO search)
        {
            //定义返回值
            List <InvoiceExportDTO> result;

            try
            {
                //调用代理方法
                result = base.Channel.GetInvoiceExport(search);
            }
            catch
            {
                //抛异常
                throw;
            }
            finally
            {
                //关链接
                ChannelClose();
            }            //返回结果
            return(result);
        }
Esempio n. 3
0
 /// <summary>
 /// 获取导出的Excel数据
 /// </summary>
 public List <InvoiceExportDTO> GetInvoiceExport(InvoiceExportDTO search)
 {
     base.Do();
     return(this.Command.GetInvoiceExport(search));
 }
Esempio n. 4
0
 /// <summary>
 /// 获取导出的Excel数据
 /// </summary>
 public List <InvoiceExportDTO> GetInvoiceExport(InvoiceExportDTO search)
 {
     base.Do(false);
     return(this.GetInvoiceExportExt(search));
 }