ldj/WcfService1/WaveRuleService.svc.cs

86 lines
2.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// <summary>
///WCF service
///FOR TABLE t_WaveRule
///By wm
///on 07/03/2020
/// </summary>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using DeiNiu.wms.Logical;
using System.Data;
using DeiNiu.wms.Data.Model;
using DeiNiu.Utils;
namespace DeiNiu.Wcf
{
// 注意: 使用“重构”菜单上的“重命名”命令可以同时更改代码、svc 和配置文件中的类名 。
public class WaveRuleService: basicService, IWaveRule
{
private static lWaveRule _lWaveRule ;
lWaveRule lWaveRuleObj
{
get
{
if ( _lWaveRule == null || _lWaveRule.operId != getOperId())
{
_lWaveRule= new lWaveRule(getOperId());
}
return _lWaveRule;
}
}
public DataSet query(string querystr, int rownumStart, int rownumEnd)
{
return lWaveRuleObj.Query(querystr, rownumStart, rownumEnd);
}
public int add(WcfWaveRule wcfData)
{
return lWaveRuleObj.add(wcfData.getDbObject());
}
public int update(WcfWaveRule wcfData)
{
return wcfData.getDbObject().Update();
}
public int delete(WcfWaveRule wcfData)
{
return wcfData.getDbObject().Delete();
}
public bool setRule(WcfWaveRule wcfData)
{
return lWaveRuleObj.setRule(wcfData);
}
public WcfWaveRule[] getWaveRules(enumWaveRuleType type)
{
DataTable dt = lWaveRuleObj.queryByType(type);
List<WcfWaveRule> lst = new List<WcfWaveRule>();
foreach (DataRow dr in dt.Rows)
{
lst.Add(new WcfWaveRule(dr));
}
return lst.ToArray();
}
public WcfWaveRule getCurrentActiveRule(Utils.enumWaveRuleType enumWaveRuleType)
{
WaveRule obj = lWaveRuleObj.getCurrentActiveRule(enumWaveRuleType);
if (obj != null)
{
return new Wcf.WcfWaveRule().getWcfObject(obj);
}
return new Wcf.WcfWaveRule();
}
}
}