예제 #1
0
 /// <summary>
 /// 分页查询获取设备预案 2016.12.04 乔会会
 /// </summary>
 /// <param name="servDevicePlanQuery"></param>
 /// <param name="pageSize">每页记录数</param>
 /// <param name="pageNumber">当前页码</param>
 /// <param name="totalNumber">共多少条</param>
 /// <returns></returns>
 public List <DevicePlanModel> GetEntities(ServDevicePlanQuery servDevicePlanQuery, int pageNumber, int pageSize, out int totalNumber)
 {
     try
     {
         List <ServDevicePlanModel> DevicePlanlist     = new List <ServDevicePlanModel>();
         List <DevicePlanModel>     devicePlanInfoList = new List <DevicePlanModel>();
         DevicePlanlist = servDevicePlanDAL.GetEntities(servDevicePlanQuery, pageSize, pageNumber, out totalNumber);
         DevicePlanModel devicePlanInfoModel;
         foreach (ServDevicePlanModel item in DevicePlanlist)
         {
             devicePlanInfoModel            = new DevicePlanModel();
             devicePlanInfoModel.id         = item.id;
             devicePlanInfoModel.plan_code  = item.plan_code;
             devicePlanInfoModel.plan_name  = item.plan_name;
             devicePlanInfoModel.plan_level = item.plan_level;
             //获取设备名称
             var u = servDeviceInfoDAL.GetEntity(item.device_id);
             devicePlanInfoModel.device_name = u == null ? "未知" : u.device_name;
             devicePlanInfoModel.create_time = item.create_time;
             //事发园区
             if (u != null)
             {
                 var a = baseRegionConfigDAL.GetEntity(u.region_id);
                 devicePlanInfoModel.region_name = a == null ? "未知" : a.region_name;
             }
             else
             {
                 devicePlanInfoModel.region_name = "未知";
             }
             devicePlanInfoModel.update_time = item.update_time;
             if (item.plan_status != (int)CSM.Common.EnumClass.PlanStatus.废止)
             {
                 devicePlanInfoModel.planStatus = Enum.GetName(typeof(EnumClass.PlanStatus), item.plan_status);
             }
             //获取创建人名称
             //var a = DeviceInfobll.GetPersonNameById(item.person_id);
             //devicePlanInfoModel.person_name = a == null ? "未知" : a.person_name;
             //devicePlanInfoModel.start_time = item.start_time;
             //devicePlanInfoModel.end_time = item.end_time;
             devicePlanInfoList.Add(devicePlanInfoModel);
         }
         return(devicePlanInfoList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
        /// <summary>
        /// 获取所有的预案信息 2016.12.02 乔会会
        /// </summary>
        /// <returns>预案信息</returns>
        public List <ServDevicePlanModel> GetDevicePlan()
        {
            ServDevicePlanQuery servDevicePlanQuery = new ServDevicePlanQuery();

            return(servDevicePlanDAL.GetEntities(servDevicePlanQuery));
        }