using Microsoft.Extensions.Logging; using SlnMesnac.Common; using SlnMesnac.Model.domain; using SlnMesnac.Repository.service.@base; using SqlSugar; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; namespace SlnMesnac.Repository.service.Impl { public class T_RP_StationPara_110_2ServiceImpl : BaseServiceImpl, IT_RP_StationPara_110_2Service { private Repository _repository; private ILogger _logger; public T_RP_StationPara_110_2ServiceImpl(Repository repository, ILogger logger) :base(repository) { _logger = logger; _repository = repository; } public async Task AddTaskAsync(T_RP_StationPara_110_2 record) { try { bool result = await _repository.InsertAsync(record); return result; } catch (Exception ex) { return false; } } public async Task GetResultAsync(string record) { try { Expression> exp = x => true; exp = exp.And(x => (x.scanbarcode == record) ); var result = await _repository.GetSingleAsync(exp); return result; } catch (Exception ex) { return null; } } public async Task UpdateResultAsync(T_RP_StationPara_110_2 t_RP_StationPara_110_2) { try { bool result = await _repository.UpdateAsync(t_RP_StationPara_110_2); return result; } catch (Exception ex) { return false; } } } }