Esempio n. 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;
        }
Esempio n. 2
0
        /// <summary>
        /// 根据报表格式编号删除报表
        /// </summary>
        /// <param name="reportNum"></param>
        /// <returns></returns>
        public int Delete(string reportNum)
        {
            ReportsEntity entity = new ReportsEntity();
            entity.IsDelete = (int)EIsDelete.Deleted;
            entity.IncludeIsDelete(true);
            entity.Where(a => a.ReportNum == reportNum);
            int line = this.Reports.Update(entity);

            return line;
        }
Esempio n. 3
0
 /// <summary>
 /// 批量删除
 /// </summary>
 /// <param name="list"></param>
 /// <returns></returns>
 public int Delete(List<string> list)
 {
     if (!list.IsNullOrEmpty())
     {
         ReportsEntity entity = new ReportsEntity();
         entity.IsDelete = (int)EIsDelete.Deleted;
         entity.IncludeIsDelete(true);
         entity.Where("ReportNum", ECondition.In, list.ToArray());
         int line = this.Reports.Update(entity);
         return line;
     }
     return 0;
 }
Esempio n. 4
0
        /// <summary>
        /// 修改报表格式
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="list"></param>
        /// <returns></returns>
        public int Update(ReportsEntity entity, List<ReportParamsEntity> list)
        {
            int line = 0;
            using (TransactionScope ts = new TransactionScope())
            {
                ReportParamsEntity param = new ReportParamsEntity();
                param.Where(a => a.ReportNum == entity.ReportNum);
                line += this.ReportParams.Delete(param);

                entity.Include(a => new { a.ReportName, a.ReportType, a.Remark, a.DataSource, a.DsType, a.FileName });
                entity.Where(a => a.ReportNum == entity.ReportNum);
                line += this.Reports.Update(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;
        }
Esempio n. 5
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;
 }
Esempio n. 6
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;
 }
Esempio n. 7
0
 /// <summary>
 /// 查询数据集
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="list"></param>
 /// <returns></returns>
 public DataSet GetDataSource(ReportsEntity entity, List<ReportParamsEntity> list,int orderType,string orderNum)
 {
     DataSet ds = null;
     if (entity.ReportType == (int)EReportType.Report)
     {
         ds = this.Reports.GetDataSource(entity, list);
     }
     else
     {
         if (orderType == (int)EOrder.InOrder)
         {
             Bill<InStorageEntity, InStorDetailEntity> bill = new InStorageOrder();
             ds = bill.GetPrint(orderNum);
         }
         else if (orderType == (int)EOrder.OutOrder)
         {
             Bill<OutStorageEntity, OutStoDetailEntity> bill = new OutStorageOrder();
             ds = bill.GetPrint(orderNum);
         }
     }
     return ds;
 }
 public ActionResult GetList()
 {
     int status = WebUtil.GetFormValue<int>("Status", 0);
     int ReportType = WebUtil.GetFormValue<int>("ReportType", -1);
     string ReportName = WebUtil.GetFormValue<string>("ReportName", string.Empty);
     int pageSize = WebUtil.GetFormValue<int>("PageSize", 10);
     int pageIndex = WebUtil.GetFormValue<int>("PageIndex", 1);
     PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize };
     ReportsEntity entity = new ReportsEntity();
     ReportProvider provider = new ReportProvider();
     if (status > -1)
     {
         entity.Where(a => a.Status == status);
     }
     if (!ReportName.IsEmpty())
     {
         entity.Where("ReportName", ECondition.Like, "%" + ReportName + "%");
     }
     if (ReportType > 0)
     {
         entity.Where(a => a.ReportType == ReportType);
     }
     List<ReportsEntity> listResult = provider.GetList(entity, ref pageInfo);
     listResult = listResult == null ? new List<ReportsEntity>() : listResult;
     string json = JsonConvert.SerializeObject(listResult);
     this.ReturnJson.AddProperty("Data", json);
     this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount);
     return Content(this.ReturnJson.ToString());
 }