113 lines
2.5 KiB
C#
113 lines
2.5 KiB
C#
|
using System;
|
|||
|
using DeiNiu.wms.Data.Model;
|
|||
|
using System.Data;
|
|||
|
namespace DeiNiu.wms.Logical
|
|||
|
{
|
|||
|
[Serializable]
|
|||
|
public class LWorkplan
|
|||
|
{
|
|||
|
Workplan _wpobj;
|
|||
|
private WorkplanDetail _wdobj;
|
|||
|
|
|||
|
|
|||
|
public LWorkplan()
|
|||
|
{
|
|||
|
|
|||
|
Initialize();
|
|||
|
}
|
|||
|
|
|||
|
public Workplan GetLWorkplan
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
return _wpobj;
|
|||
|
}
|
|||
|
}
|
|||
|
public WorkplanDetail GetLWorkplanDetail
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
return _wdobj;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// get all data
|
|||
|
/// </summary>
|
|||
|
public DataSet GetAllData()
|
|||
|
{
|
|||
|
return _wpobj.Query();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// get all data
|
|||
|
/// </summary>
|
|||
|
public DataSet GetAllActiveData()
|
|||
|
{
|
|||
|
return _wpobj.QueryActived();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20>鿴<EFBFBD>û<EFBFBD>ij<EFBFBD>յĹ<D5B5><C4B9><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>Workplan
|
|||
|
/// </summary>
|
|||
|
/// <param name="empId"></param>
|
|||
|
/// <param name="date"></param>
|
|||
|
/// <param name="createNew"><3E>Ƿ<C7B7><F1B4B4BD>µģ<C2B5><C4A3><EFBFBD><EFBFBD><EFBFBD>createNew=true,<2C><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>¼<EFBFBD><EFBFBD></param>
|
|||
|
/// <returns></returns>
|
|||
|
public bool CheckWorkplan(int empId,string date,bool createNew)
|
|||
|
{
|
|||
|
DataTable dt = _wpobj.getWorkplanByDate(empId, date);
|
|||
|
if (dt.Rows.Count == 0 && createNew)
|
|||
|
{
|
|||
|
|
|||
|
_wpobj = new Workplan();
|
|||
|
_wpobj.wp_emp = empId;
|
|||
|
_wpobj.wp_date = date;
|
|||
|
_wpobj.Add();
|
|||
|
_wdobj = new WorkplanDetail();
|
|||
|
_wdobj.wpd_workplan = _wpobj.ID;
|
|||
|
}
|
|||
|
return dt.Rows.Count >0;
|
|||
|
}
|
|||
|
|
|||
|
/*
|
|||
|
private void leavetypeDsConstruct()
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
*/
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// get a record by id
|
|||
|
/// </summary>
|
|||
|
public void Initialize(int id)
|
|||
|
{
|
|||
|
_wdobj = id != 0 ? new WorkplanDetail(id) : new WorkplanDetail();
|
|||
|
_wpobj = id != 0 ? new Workplan(_wdobj.wpd_workplan) : new Workplan();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// get a record by id 0
|
|||
|
/// </summary>
|
|||
|
public void Initialize()
|
|||
|
{
|
|||
|
Initialize(0);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// get a record by id 0
|
|||
|
/// </summary>
|
|||
|
public void InitializeDetail()
|
|||
|
{
|
|||
|
_wdobj = new WorkplanDetail();
|
|||
|
}
|
|||
|
public int getNexNumber(int WorkplanId)
|
|||
|
{
|
|||
|
return _wpobj.getNextNumber(WorkplanId);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|