Example #1
0
        /// <summary>
        /// 创建报表文件格式
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="list"></param>
        /// <returns></returns>
        public int Create(ReportsEntity entity,List<ReportParamsEntity> list)
        {
            if (!entity.ReportNum.IsEmpty())
            {
                return Update(entity,list);
            }
            int line = 0;
            using (TransactionScope ts = new TransactionScope())
            {
                entity.ReportNum = entity.ReportNum.IsEmpty() ? SequenceProvider.GetSequence(typeof(ReportsEntity)) : entity.ReportNum;
                entity.IncludeAll();
                line += this.Reports.Add(entity);

                if (!list.IsNullOrEmpty())
                {
                    foreach (ReportParamsEntity item in list)
                    {
                        item.ParamNum = item.ParamNum.IsEmpty() ? SequenceProvider.GetSequence(typeof(ReportParamsEntity)) : item.ParamNum;
                        item.ReportNum = entity.ReportNum;
                        item.IncludeAll();
                    }
                    this.ReportParams.Add(list);
                }
                ts.Complete();
            }

            return line;
        }
Example #2
0
 /// <summary>
 /// 查询报表
 /// </summary>
 /// <param name="argReportNum"></param>
 /// <returns></returns>
 public ReportsEntity GetReport(string argReportNum)
 {
     ReportsEntity entity = new ReportsEntity();
     entity.IncludeAll();
     entity.Where(a => a.ReportNum == argReportNum)
         .And(a=>a.IsDelete==(int)EIsDelete.NotDelete)
         ;
     entity = this.Reports.GetSingle(entity);
     return entity;
 }
Example #3
0
 /// <summary>
 /// 报表查询分页
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="pageInfo"></param>
 /// <returns></returns>
 public List<ReportsEntity> GetList(ReportsEntity entity, ref PageInfo pageInfo)
 {
     entity.IncludeAll();
     entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete);
     entity.OrderBy(a => a.ID,EOrderBy.ASC);
     int rowCount = 0;
     List<ReportsEntity> listResult = this.Reports.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);
     pageInfo.RowCount = rowCount;
     return listResult;
 }