using InSituLaboratory.Entities; using InSituLaboratory.IService; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata.Ecma335; using System.Text; using System.Threading.Tasks; namespace InSituLaboratory.Service { public class DeviceService : BaseService, IDeviceSvice { public DeviceService(DbContext context) : base(context) { } public IEnumerable GetDevices() { return this.Set(); } /// /// 根据设备名称查询预设工作时长 /// /// /// public string GetDeviceByDeviceName(string DeviceName) { var workTime = ""; var sysDevice = this.Query(m=> m.DeviceName == DeviceName).ToList(); foreach (var item in sysDevice) { workTime = item.WorkTime; } return workTime; } /// /// 根据设备名称查询预设最小工作时长 /// /// /// public string GetDeviceByDeviceNameMinTime(string DeviceName) { var workTime = ""; var sysDevice = this.Query(m => m.DeviceName == DeviceName).ToList(); foreach (var item in sysDevice) { workTime = item.MinWorkTime; } return workTime; } } }