123 lines
2.3 KiB
C#
123 lines
2.3 KiB
C#
|
|
/// <summary>
|
|
///LOGIC CLASS FOR TABLE t_Owner
|
|
///By wm with codesmith.
|
|
///on 08/16/2018
|
|
/// </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 lOwner :lbase
|
|
{
|
|
Owner _obj;
|
|
public lOwner()
|
|
{
|
|
initialize();
|
|
}
|
|
|
|
public Owner getOwner
|
|
{
|
|
get
|
|
{
|
|
if (_obj == null)
|
|
{
|
|
_obj = new Owner();
|
|
|
|
}
|
|
_obj.operater = operId;
|
|
return _obj;
|
|
}
|
|
}
|
|
|
|
public lOwner(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 Owner(id) : new Owner();
|
|
}
|
|
|
|
/// <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 Owner(dr);
|
|
}
|
|
|
|
protected override DeiNiu.Data.BaseObject.BaseModel getModel()
|
|
{
|
|
return _obj;
|
|
}
|
|
|
|
//begin cust db operation, query, excute sql etc.
|
|
|
|
internal int add(Owner obj)
|
|
{
|
|
obj.ownerCode = Utils.Util.GenerateRandomNumber(11);
|
|
return obj.Add();
|
|
}
|
|
|
|
/// <summary>
|
|
/// update in a transaction scrop
|
|
/// </summary>
|
|
|
|
public void update()
|
|
{
|
|
_obj.Update();
|
|
|
|
}
|
|
|
|
public int syncOwner()
|
|
{
|
|
return _obj.syncOwner();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|