using WIDESEA_Core; using WIDESEA_Core.BaseRepository; using WIDESEA_Core.BaseServices; using WIDESEA_IBusinessesRepository; using WIDESEA_IBusinessServices; using WIDESEA_IStorageSocketServices; using WIDESEA_Model.Models; using WIDESEA_Repository; using WIDESEA_StorageSocketServices; namespace WIDESEA_BusinessServices { public class Dt_HandAutomaticService : ServiceBase, IDt_HandAutomaticService { private readonly IUnitOfWorkManage _unitOfWorkManage; public SocketClientService _Socket { get; set; } public Dt_HandAutomaticService(IDt_HandAutomaticRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, SocketClientService socketClientService) : base(BaseDal) { _unitOfWorkManage = unitOfWorkManage; _Socket = socketClientService; } public bool GetAutoStatus() { var HandAutomatic = BaseDal.QueryFirst(x => true && x.HandAutomatic == "Automatic"); if (HandAutomatic != null) { return true; } return false; } public WebResponseContent AutoStatus(string auto) { WebResponseContent content = new WebResponseContent(); var HandAutomatic = BaseDal.QueryFirst(x => true); if (auto == "true") { HandAutomatic.HandAutomatic = "Automatic"; BaseDal.UpdateData(HandAutomatic); return content.OK(); } else { HandAutomatic.HandAutomatic = "Manual"; BaseDal.UpdateData(HandAutomatic); return content.Error(); } } } }