using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.DAL;
using QMAPP.FJC.Entity.ProduceManage;
using QMFrameWork.Data;
using System.Data;
namespace QMAPP.FJC.DAL.ProduceManage
{
public class MenderReasonDAL : BaseDAL
{
///
/// 插入缺陷信息
///
///
public void Insert(MenderReason entity)
{
this.BaseSession.Insert(entity);
}
///
/// 获取缺陷信息
///
///
///
public List GetList(MenderReason condition)
{
List list = new List();
string sql = string.Format("SELECT DEFECTKEY,DEFECTVALUE,POSITION FROM T_AW_MENDERREASON where ppid='{0}'",condition.PPID);
using (IDataSession session = AppDataFactory.CreateMainSession())
{
list = session.GetList(sql, new List().ToArray()).ToList();
}
return list;
}
public MendRecorder GetMaterialTeam(string MaterialCode)
{
string sql = string.Format("SELECT PROJECTCODE FROM T_MD_MATERIAL where MATERIAL_CODE='{0}'", MaterialCode);
using (IDataSession session = AppDataFactory.CreateMainSession())
{
return session.Get(sql, new List().ToArray());
}
}
public MendRecorder GetWorkLine(string workCellCode)
{
string sql = string.Format("SELECT MFGCODE as ERP_WORKLINE FROM T_AW_MENDRECORDERERP where MFGCODETYPE='WORKLINE' and TYPE_CODE='{0}'", workCellCode);
using (IDataSession session = AppDataFactory.CreateMainSession())
{
return session.Get(sql, new List().ToArray());
}
}
}
}