Esempio n. 1
0
        /// <summary>
        /// 查询
        /// 1.依据财产编号查询
        /// 2.依据财产编号精确查询
        /// </summary>
        /// <param name="qryDto">设备查询数据传输对象 </param>
        /// <returns></returns>
        public List <EquipmentMaintenanceRecordModel> FindBy(QueryEquipmentDto qryDto)
        {
            try
            {
                switch (qryDto.SearchMode)
                {
                case 1:     //依据财产编号查询
                    return(irep.Entities.Where(m => m.AssetNumber.StartsWith(qryDto.AssetNumber)).ToList());

                case 2:     //依据财产编号精确查询
                    return(irep.Entities.Where(m => m.AssetNumber == qryDto.AssetNumber).ToList());

                default: return(null);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 查询
        /// 1.依据财产编号(包含)查询
        /// 2.依据保管部门查询
        /// 3.依据录入日期查询
        /// 4.依据录入日期查询待校验设备
        /// 5.依据录入日期查询待保养设备
        /// 6.生成设备总览表
        /// </summary>
        /// <param name="qryDto">设备查询数据传输对象 </param>
        /// <returns></returns>
        public List <EquipmentModel> FindBy(QueryEquipmentDto qryDto)
        {
            try
            {
                switch (qryDto.SearchMode)
                {
                case 1:     //依据财产编号查询
                    return(irep.Entities.Where(m => m.AssetNumber == qryDto.AssetNumber).ToList());

                case 2:     //依据保管部门查询
                    return(irep.Entities.Where(m => m.SafekeepDepartment.Contains(qryDto.Department)).ToList());

                //return irep.Entities.Where(m => m.SafekeepDepartment.StartsWith(qryDto.Department, StringComparison.CurrentCulture)).ToList();

                case 3:     //依据录入日期查询
                    DateTime inputDate = qryDto.InputDate.ToDate();
                    return(irep.Entities.Where(m => m.InputDate == inputDate).ToList());

                case 4:     //依据录入日期查询待校验设备  //结束日期=输入日期加一个月 超期设备等于 计划日期<=当天日期
                    DateTime startPlannedDate = qryDto.PlannedCheckDate.ToDate(), endPlannedDate = startPlannedDate.AddMonths(1), nowDate = DateTime.Now.ToDate();
                    return(irep.Entities.Where(m => (m.IsScrapped == "否" && m.IsCheck == "是" && m.PlannedCheckDate >= startPlannedDate && m.PlannedCheckDate <= endPlannedDate) || (m.IsScrapped == "正常" && m.IsCheck == "是" && m.PlannedCheckDate <= nowDate)).ToList());

                case 5:     //依据录入日期查询待保养设备  //按计划保养月查询待保养待设备列表
                    return(irep.Entities.Where(m => m.IsMaintenance == "是" && m.PlannedMaintenanceMonth == qryDto.PlannedMaintenanceMonth).ToList());

                case 6:     //查询所有在使用待设备 生成设备总览表
                    return(irep.Entities.Where(m => m.IsScrapped == "否").ToList());

                case 7:     //依据财产编号查询
                    return(irep.Entities.Where(m => m.AssetNumber.Contains(qryDto.AssetNumber)).ToList());

                default:
                    return(new List <EquipmentModel>());
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.Message);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 查询 1.依据财产编号查询 2.依据保管部门查询 3.依据录入日期查询
 /// 4.依据录入日期查询待校验设备 5.依据录入日期查询待保养设备
 /// </summary>
 /// <param name="qryDto">设备查询数据传输对象 </param>
 /// <returns></returns>
 public List <EquipmentModel> FindBy(QueryEquipmentDto qryDto)
 {
     return(CrudFactory.EquipmentCrud.FindBy(qryDto));
 }
Esempio n. 4
0
 /// <summary>
 /// 查询 1.依据财产编号查询
 /// </summary>
 /// <param name="qryDto">设备查询数据传输对象 </param>
 /// <returns></returns>
 public List <EquipmentMaintenanceRecordModel> FindBy(QueryEquipmentDto qryDto)
 {
     return(CrudFactory.EquipmentMaintenanceCrud.FindBy(qryDto));
 }