ldj/epickx/BLL/lWmsDeskCustomer.cs

145 lines
3.0 KiB
C#
Raw Normal View History

2023-05-23 16:13:17 +08:00

/// <summary>
///LOGIC CLASS FOR TABLE t_wmsDeskCustomer
///By wm with codesmith.
///on 07/21/2019
/// </summary>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DeiNiu.wms.Data.Model;
using System.Data;
using System.Transactions;
namespace DeiNiu.wms.Logical
{
[Serializable]
public class lWmsDeskCustomer : lbase
{
WmsDeskCustomer _obj;
public lWmsDeskCustomer()
{
initialize();
}
public WmsDeskCustomer getWmsDeskCustomer
{
get
{
if (_obj == null)
{
_obj = new WmsDeskCustomer();
}
_obj.operater = operId;
return _obj;
}
}
public lWmsDeskCustomer(int operId)
: base(operId)
{
initialize();
}
/// <summary>
/// get all data
/// </summary>
public DataSet getAllData()
{
return _obj.Query();
}
/// <summary>
/// get all data
/// </summary>
public DataSet getAllActiveData()
{
return _obj.QueryActived();
}
/// <summary>
/// get a record by id
/// </summary>
public void initialize(int id)
{
_obj = id != 0 ? new WmsDeskCustomer(id) : new WmsDeskCustomer();
}
/// <summary>
/// get a record by id 0
/// </summary>
public void initialize()
{
initialize(0);
}
/// <summary>
/// get a record by id
/// </summary>
public void initialize(DataRow dr)
{
_obj = new WmsDeskCustomer(dr);
}
protected override DeiNiu.Data.BaseObject.BaseModel getModel()
{
return _obj;
}
//begin cust db operation, query, excute sql etc.
internal int add(WmsDeskCustomer obj)
{
return obj.Add();
}
/// <summary>
/// update in a transaction scrop
/// </summary>
public void update()
{
if (valid())
{
using (TransactionScope scope = new TransactionScope())
{
//Node tmp = new Node();
//tmp.parentid = 1;
//tmp.name = "test trans" + DateTime.Now;
//tmp.description = "this is for transTest";
//tmp.Add();
_obj.Update();
scope.Complete();
}
}
}
private bool valid()
{
return true;
}
public void trunckData()
{
getWmsDeskCustomer.trunckData();
}
internal int setupPort(int deskId, int portNo, int startId, int endId)
{
return getWmsDeskCustomer.updatePorts(deskId,portNo,startId,endId);
}
}
}