Exemplo n.º 1
0
 /// <summary>
 /// 分页查询获取预案条例
 /// </summary>
 /// <param name="servDevicePlanQuery"></param>
 /// <param name="pageSize">每页记录数</param>
 /// <param name="pageNumber">当前页码</param>
 /// <param name="totalNumber">共多少条</param>
 /// <returns></returns>
 public List <PlanRegulationModel> GetEntities(ServPlanRegulationQuery servPlanRegulationQuery, int pageNumber, int pageSize, out int totalNumber)
 {
     try
     {
         List <ServPlanRegulationModel> ServPlanRegulationlist = new List <ServPlanRegulationModel>();
         List <PlanRegulationModel>     PlanRegulationList     = new List <PlanRegulationModel>();
         ServPlanRegulationlist = servPlanRegulationDAL.GetEntities(servPlanRegulationQuery, pageSize, pageNumber, out totalNumber);
         PlanRegulationModel planRegulationModel;
         foreach (ServPlanRegulationModel item in ServPlanRegulationlist)
         {
             planRegulationModel               = new PlanRegulationModel();
             planRegulationModel.id            = item.id;
             planRegulationModel.reg_name      = item.reg_name;
             planRegulationModel.reg_levelName = Enum.GetName(typeof(EnumClass.PlanRegulation), item.reg_level);
             planRegulationModel.create_time   = item.create_time;
             planRegulationModel.update_time   = item.update_time;
             //var u = servPlanRegulationDAL.GetFileName(item.id);
             //planRegulationModel.file_name = u == null ? "未知" : u.file_name;
             planRegulationModel.keyword = item.keyword;
             var a = baseEventTypeDAL.GetEntity(item.reg_type);
             planRegulationModel.reg_typeName = a == null ? "未知" : a.event_name;
             PlanRegulationList.Add(planRegulationModel);
         }
         return(PlanRegulationList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 获取预案条例信息
        /// </summary>
        /// <param name="regId"></param>
        /// <returns></returns>
        public PlanRegulationModel GetPlanRegulations(int regId)
        {
            try
            {
                //获取预案条例信息
                ServPlanRegulationModel entity = servPlanRegulationDAL.GetEntity(regId);

                //获取关联文件
                List <ServRegulationFileModel> RegulationFile = servRegulationFileDAL.GetRegulationFile(regId);
                //获取文件信息
                List <ServFileInfoModel> FileInfoList = new List <ServFileInfoModel>();
                for (var i = 0; i < RegulationFile.Count; i++)
                {
                    ServFileInfoModel fileInfo = servFileInfoDAL.GetEntity(RegulationFile[i].file_id);
                    FileInfoList.Add(fileInfo);
                }
                //获取文件信息
                PlanRegulationModel model = new PlanRegulationModel();
                model.id        = entity.id;
                model.keyword   = entity.keyword;
                model.person_id = entity.person_id;
                model.reg_level = entity.reg_level;
                model.reg_name  = entity.reg_name;
                model.reg_type  = entity.reg_type;
                var a = baseEventTypeDAL.GetEntity(entity.reg_type);
                model.reg_typeName  = a == null ? "未知" : a.event_name;
                model.reg_levelName = Enum.GetName(typeof(EnumClass.PlanRegulation), entity.reg_level);
                model.create_time   = entity.create_time;
                model.update_time   = entity.update_time;
                model.FileInfoList  = FileInfoList;
                return(model);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }