88 lines
2.0 KiB
C#
88 lines
2.0 KiB
C#
|
|
/// <summary>
|
|
///INTERFACE CLASS FOR TABLE t_WaveRule
|
|
///By wm
|
|
///on 07/03/2020
|
|
/// </summary>
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Data;
|
|
|
|
namespace DeiNiu.wms.Data.Model
|
|
{
|
|
[Serializable]
|
|
public class WaveRule : WaveRule_base
|
|
{
|
|
public WaveRule()
|
|
{
|
|
|
|
}
|
|
|
|
public WaveRule(int id): base(id)
|
|
{
|
|
|
|
}
|
|
public WaveRule(DataRow dr): base(dr)
|
|
{
|
|
|
|
}
|
|
protected override void getImp()
|
|
{
|
|
model_imp = new WaveRule_Imp();
|
|
}
|
|
|
|
//begin cust db operation, query, excute sql etc.
|
|
public DataSet QueryByName(string name)
|
|
{
|
|
cmdParameters[0] = name;
|
|
return CustQuery(100);
|
|
}
|
|
|
|
public bool setCurrentRule(int id, int interVal, int type,int operater)
|
|
{
|
|
cmdParameters[0] = type ;
|
|
WaveRule wr = new WaveRule(id);
|
|
if (wr.ID > 0)
|
|
{
|
|
CustOper(200);
|
|
wr.interval = interVal;
|
|
wr.operater = operater;
|
|
wr.active = true;
|
|
if (wr.Update() > 0)
|
|
{
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
public WaveRule getCurrentActiveRule(Utils.enumWaveRuleType enumWaveRuleType)
|
|
{
|
|
cmdParameters[0] = (int)enumWaveRuleType;
|
|
DataTable dt = CustQuery(300).Tables[0];
|
|
foreach (DataRow dr in dt.Rows )
|
|
{
|
|
return new WaveRule(dr);
|
|
|
|
}
|
|
WaveRule wr = new WaveRule();
|
|
wr.type = (int)enumWaveRuleType;
|
|
return wr;
|
|
|
|
}
|
|
|
|
public DataTable queryByType(Utils.enumWaveRuleType enumWaveRuleType)
|
|
{
|
|
cmdParameters[0] = (int)enumWaveRuleType;
|
|
|
|
return CustQuery(400).Tables[0];
|
|
}
|
|
}
|
|
}
|
|
|