天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
2.0 KiB

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
{
/// <summary>
/// 插入缺陷信息
/// </summary>
/// <param name="entity"></param>
public void Insert(MenderReason entity)
{
this.BaseSession.Insert<MenderReason>(entity);
}
/// <summary>
/// 获取缺陷信息
/// </summary>
/// <param name="condition"></param>
/// <returns></returns>
public List<MenderReason> GetList(MenderReason condition)
{
List<MenderReason> list = new List<MenderReason>();
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<MenderReason>(sql, new List<DataParameter>().ToArray()).ToList<MenderReason>();
}
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<MendRecorder>(sql, new List<DataParameter>().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<MendRecorder>(sql, new List<DataParameter>().ToArray());
}
}
}
}