using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Data;
|
|
namespace DAL
|
{
|
public class ClsGy_SourceWorkStationSet : DBUtility.ClsGy_Base_Ctl
|
{
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
public Model.ClsGy_SourceWorkStationSet oModel = new Model.ClsGy_SourceWorkStationSet();
|
//构造函数
|
public ClsGy_SourceWorkStationSet()
|
{
|
MvarItemKey = "Gy_SourceWorkStationSet";
|
MvarReportTitle = "产线工位";
|
oModel = new Model.ClsGy_SourceWorkStationSet();
|
}
|
|
//新增
|
public override bool AddNew()
|
{
|
try
|
{
|
string ssql = "Insert into " + MvarItemKey + " " +
|
"(HMacAddr,HSourceID,HProdOrgID,HWorkStationID,HProcID," +
|
" HType,HVideo,HRemark,HCreateDate,HCreator)" +
|
" Values('" + oModel.HMacAddr + "'," + oModel.HSourceID + "," + oModel.HProdOrgID + "," + oModel.HWorkStationID + ","
|
+ oModel.HProcID + ",'" + oModel.HType + "'," + oModel.HVideo + ",'" + oModel.HRemark + "','"
|
+ oModel.HCreateDate + "','" + oModel.HCreator + "')";
|
oCn.BeginTran();
|
oCn.RunProc(ssql, ref DBUtility.ClsPub.sExeReturnInfo);
|
oCn.Commit();
|
return true;
|
}
|
catch (Exception e)
|
{
|
oCn.RollBack();
|
throw (e);
|
}
|
}
|
|
//修改
|
public override bool ModifyByID(Int64 sItemID)
|
{
|
try
|
{
|
string ssql = "Update " + MvarItemKey + " set " +
|
"HMacAddr='" + oModel.HMacAddr + "'" +
|
",HSourceID='" + oModel.HSourceID + "'" +
|
",HProdOrgID='" + oModel.HProdOrgID + "'" +
|
",HWorkStationID= '" + oModel.HWorkStationID + "'" +
|
",HProcID='" + oModel.HProcID + "'" +
|
",HType='" + oModel.HType + "'" +
|
",HVideo='" + oModel.HVideo +"' Where HItemID = " + sItemID;
|
oCn.BeginTran();
|
oCn.RunProc(ssql, ref DBUtility.ClsPub.sExeReturnInfo);
|
oCn.Commit();
|
return true;
|
}
|
catch (Exception e)
|
{
|
oCn.RollBack();
|
throw (e);
|
}
|
}
|
}
|
}
|