158 lines
4.0 KiB
C#
158 lines
4.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Ease.CoreV35;
|
|
using Ease.CoreV35.Model;
|
|
using Ease.CoreV35.Caching;
|
|
using System.Data.Linq.Mapping;
|
|
|
|
namespace Payroll.BO
|
|
{
|
|
#region JVSetupCC
|
|
[Serializable]
|
|
public class JVSetupCC : BasicBaseObject
|
|
{
|
|
public delegate void ItemChanged();
|
|
|
|
#region Cache Store
|
|
private static Cache _cache = new Cache(typeof(JVSetupCC));
|
|
#endregion
|
|
|
|
#region Constructor
|
|
public JVSetupCC()
|
|
{
|
|
_jvSetupID = null;
|
|
_CCID = null;
|
|
}
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
#region CCID
|
|
private ID _CCID;
|
|
public ID CCID
|
|
{
|
|
get
|
|
{
|
|
return _CCID;
|
|
}
|
|
set
|
|
{
|
|
base.OnPropertyChange<ID>("CCID", _CCID, value);
|
|
_CCID = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region JVSetupID
|
|
private ID _jvSetupID;
|
|
public ID JVSetupID
|
|
{
|
|
get
|
|
{
|
|
return _jvSetupID;
|
|
}
|
|
set
|
|
{
|
|
base.OnPropertyChange<ID>("jvSetupID", _jvSetupID, value);
|
|
_jvSetupID = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region Functions
|
|
public JVSetupCC Get(ID nJVSetupCCID)
|
|
{
|
|
JVSetupCC oJVSetupCC = null;
|
|
#region Cache Header
|
|
oJVSetupCC = (JVSetupCC)_cache["Get", nJVSetupCCID];
|
|
if (oJVSetupCC != null)
|
|
return oJVSetupCC;
|
|
#endregion
|
|
oJVSetupCC = JVSetupCC.Service.Get(nJVSetupCCID);
|
|
#region Cache Footer
|
|
_cache.Add(oJVSetupCC, "Get", nJVSetupCCID);
|
|
#endregion
|
|
return oJVSetupCC;
|
|
}
|
|
public static ObjectsTemplate<JVSetupCC> Get()
|
|
{
|
|
#region Cache Header
|
|
ObjectsTemplate<JVSetupCC> joJVSetupCCs = _cache["Get"] as ObjectsTemplate<JVSetupCC>;
|
|
if (joJVSetupCCs != null)
|
|
return joJVSetupCCs;
|
|
#endregion
|
|
try
|
|
{
|
|
joJVSetupCCs = Service.Get();
|
|
}
|
|
catch (ServiceException e)
|
|
{
|
|
throw new Exception(e.Message, e);
|
|
}
|
|
#region Cache Footer
|
|
_cache.Add(joJVSetupCCs, "Get");
|
|
#endregion
|
|
return joJVSetupCCs;
|
|
}
|
|
public static ObjectsTemplate<JVSetupCC> GetByJVSetup(ID nJVSetupID)
|
|
{
|
|
#region Cache Header
|
|
ObjectsTemplate<JVSetupCC> jvsetupCCs = _cache["GetByJVSetup", nJVSetupID] as ObjectsTemplate<JVSetupCC>;
|
|
if (jvsetupCCs != null)
|
|
return jvsetupCCs;
|
|
#endregion
|
|
try
|
|
{
|
|
jvsetupCCs = Service.GetByJVSetup(nJVSetupID);
|
|
}
|
|
catch (ServiceException e)
|
|
{
|
|
throw new Exception(e.Message, e);
|
|
}
|
|
#region Cache Footer
|
|
_cache.Add(jvsetupCCs, "GetByJVSetup", nJVSetupID);
|
|
#endregion
|
|
return jvsetupCCs;
|
|
}
|
|
|
|
public ID Save()
|
|
{
|
|
this.SetAuditTrailProperties();
|
|
return JVSetupCC.Service.Save(this);
|
|
}
|
|
|
|
public void Delete(ID id)
|
|
{
|
|
JVSetupCC.Service.Delete(id);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Service Factory
|
|
internal static IJVSetupCCService Service
|
|
{
|
|
get
|
|
{
|
|
return Services.Factory.CreateService<IJVSetupCCService>(typeof(IJVSetupCCService));
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region IJVSetupDetail Service
|
|
public interface IJVSetupCCService
|
|
{
|
|
JVSetupCC Get(ID id);
|
|
ObjectsTemplate<JVSetupCC> Get();
|
|
ObjectsTemplate<JVSetupCC> GetByJVSetup(ID nJVSetupID);
|
|
ID Save(JVSetupCC oJVSetupDetail);
|
|
void Delete(ID id);
|
|
}
|
|
#endregion
|
|
}
|