using System;
using SqlSugar;
using Infrastructure.Attribute;
using Infrastructure.Extensions;
using DOAN.Model;
using DOAN.Model.Dto;
using DOAN.Service.MES.quality.IPQC.IService;
using DOAN.Model.MES.quality.IPQC.Dto;
using DOAN.Model.MES.quality.IPQC;
using DOAN.Repository;
using DOAN.Service.Business.IBusinessService;
using System.Linq;
namespace DOAN.Service.MES.quality.IPQC
{
///
/// 追溯零件清单Service业务层处理
///
[AppService(ServiceType = typeof(IQcIpqcTraceProjectPartService), ServiceLifetime = LifeTime.Transient)]
public class QcIpqcTraceProjectPartService : BaseService, IQcIpqcTraceProjectPartService
{
///
/// 查询追溯零件清单列表
///
///
///
public PagedInfo GetList(QcIpqcTraceProjectPartQueryDto parm)
{
var predicate = Expressionable.Create();
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage(parm);
return response;
}
///
/// 获取详情
///
///
///
public QcIpqcTraceProjectPart GetInfo(int Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
///
/// 添加追溯零件清单
///
///
///
public QcIpqcTraceProjectPart AddQcIpqcTraceProjectPart(QcIpqcTraceProjectPart model)
{
return Context.Insertable(model).ExecuteReturnEntity();
}
///
/// 修改追溯零件清单
///
///
///
public int UpdateQcIpqcTraceProjectPart(QcIpqcTraceProjectPart model)
{
//var response = Update(w => w.Id == model.Id, it => new QcIpqcTraceProjectPart()
//{
// ProjectCode = model.ProjectCode,
// ProductionCode = model.ProductionCode,
// ProductionName = model.ProductionName,
// Specification = model.Specification,
// Colour = model.Colour,
// HandleType = model.HandleType,
// CustomCode = model.CustomCode,
// Unit = model.Unit,
//});
//return response;
return Update(model, true);
}
}
}