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.
59 lines
2.0 KiB
59 lines
2.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using QMAPP.FJC.Entity.Operation;
|
|
using QMFrameWork.Data;
|
|
using QMAPP.DAL;
|
|
|
|
namespace QMAPP.FJC.DAL.Operation
|
|
{
|
|
public class MainMolderStatusDAL : BaseDAL
|
|
{
|
|
/// <summary>
|
|
/// 通过设备号和模架号获取模架使用状态对象
|
|
/// </summary>
|
|
/// <param name="conditioin"></param>
|
|
/// <returns></returns>
|
|
public MainMolderStatus Get(MainMolderStatus condition)
|
|
{
|
|
MainMolderStatus entity = new MainMolderStatus();
|
|
|
|
string sql = "select * from T_AW_MAINMOLDERSTATUS where 1=1 ";
|
|
|
|
if (string.IsNullOrEmpty(condition.MACHINECODDE) == false)
|
|
{
|
|
sql += string.Format(" and MACHINECODDE='{0}'",condition.MACHINECODDE);
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(condition.MOLDNUMBER) == false)
|
|
{
|
|
sql += string.Format(" and MOLDNUMBER='{0}'", condition.MOLDNUMBER);
|
|
}
|
|
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
entity = session.Get<MainMolderStatus>(sql, new List<DataParameter>().ToArray());
|
|
}
|
|
|
|
return entity;
|
|
}
|
|
|
|
public void Update(MainMolderStatus condition)
|
|
{
|
|
string updateSql = string.Format("update T_AW_MAINMOLDERSTATUS set OPERATIONFLAG={0},BARCODE='{3}' where MACHINECODDE='{1}' and MOLDNUMBER='{2}'",
|
|
condition.OPERATIONFLAG, condition.MACHINECODDE, condition.MOLDNUMBER,condition.BARCODE);
|
|
if (BaseSession != null)
|
|
{
|
|
BaseSession.ExecuteSql(updateSql, new List<DataParameter>().ToArray());
|
|
}
|
|
else
|
|
{
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
session.ExecuteSql(updateSql, new List<DataParameter>().ToArray());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|