You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.0 KiB
C#
67 lines
2.0 KiB
C#
using Microsoft.Extensions.Logging;
|
|
using SlnMesnac.Common;
|
|
using SlnMesnac.Model.domain;
|
|
using SlnMesnac.Repository.service.@base;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq.Expressions;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SlnMesnac.Repository.service.Impl
|
|
{
|
|
|
|
public class T_RP_StationPara_130ServiceImpl : BaseServiceImpl<T_RP_StationPara_130>, IT_RP_StationPara_130Service
|
|
{
|
|
private Repository<T_RP_StationPara_130> _repository;
|
|
private ILogger<T_RP_StationPara_130ServiceImpl> _logger;
|
|
public T_RP_StationPara_130ServiceImpl(Repository<T_RP_StationPara_130> repository, ILogger<T_RP_StationPara_130ServiceImpl> logger) :base(repository)
|
|
{
|
|
_repository = repository;
|
|
_logger = logger;
|
|
}
|
|
|
|
|
|
public async Task<bool> AddTaskAsync(List<T_RP_StationPara_130> record)
|
|
{
|
|
try
|
|
{
|
|
bool result = await _repository.InsertRangeAsync(record);
|
|
return result;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
}
|
|
public async Task<T_RP_StationPara_130> GetResultAsync(string jpcode)
|
|
{
|
|
try
|
|
{
|
|
Expression<Func<T_RP_StationPara_130, bool>> exp = x => true;
|
|
exp = exp.And(x =>
|
|
(x.scanbarcode == jpcode)
|
|
);
|
|
var result = await _repository.GetFirstAsync(exp);
|
|
return result;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public async Task<bool> UpdateResultAsync(T_RP_StationPara_130 t_RP_StationPara_110_1)
|
|
{
|
|
try
|
|
{
|
|
bool result = await _repository.UpdateAsync(t_RP_StationPara_110_1);
|
|
return result;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
} |