/// <summary>
 /// 根据存储过程名称查询元数据信息
 /// </summary>
 /// <param name="argProceName"></param>
 /// <returns></returns>
 public List<ReportParamsEntity> GetProceMetadata(string argProceName)
 {
     List<ProceMetadata> list = this.Reports.GetMetadataList(argProceName);
     if (!list.IsNullOrEmpty())
     {
         List<ReportParamsEntity> listResult = new List<ReportParamsEntity>();
         foreach (ProceMetadata item in list)
         {
             ReportParamsEntity entity = new ReportParamsEntity();
             entity.ReportNum = string.Empty;
             entity.ParamNum = SequenceProvider.GetSequence(typeof(ReportParamsEntity));
             entity.InputNo = item.ORDINAL_POSITION.ToString();
             entity.ParamName = item.PARAMETER_NAME;
             entity.ShowName = string.Empty;
             entity.ParamType = item.DATA_TYPE;
             entity.ParamData = "";
             entity.DefaultValue = "";
             listResult.Add(entity);
         }
         return listResult;
     }
     return null;
 }
        /// <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;
        }
 /// <summary>
 /// 根据报表格式编号查询参数信息
 /// </summary>
 /// <param name="reportNum"></param>
 /// <returns></returns>
 public List<ReportParamsEntity> GetParams(string reportNum)
 {
     ReportParamsEntity entity = new ReportParamsEntity();
     entity.IncludeAll();
     entity.Where(a => a.ReportNum == reportNum);
     List<ReportParamsEntity> list = this.ReportParams.GetList(entity);
     return list;
 }