using Admin.Core.IRepository; using Admin.Core.IService; using Admin.Core.Model; using log4net; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Admin.Core.Service { internal class RecordElectricalinspectionServices : BaseServices, IRecordElectricalinspectionService { private IBaseRepository _dal; private static readonly log4net.ILog _logger = LogManager.GetLogger(typeof(RecordElectricalinspectionServices)); public RecordElectricalinspectionServices(IBaseRepository dal) { this._dal = dal; base.BaseDal = dal; } public bool InsertRecordElectricalinspection(RecordElectricalinspection electricalinspection) { bool result = false; try { var r = _dal.AddAsync(electricalinspection).Result; if (r >0) { result = true; } }catch(Exception ex) { _logger.Error($"电检数据保存异常:{ex.Message}"); } return result; } } }