270 lines
6.6 KiB
C#
270 lines
6.6 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Data;
|
|
using System.Collections.Generic;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region class Fund
|
|
[Serializable]
|
|
public class FmFund : AuditTrailBase //,IDisplayProperty
|
|
{
|
|
|
|
#region Constructor
|
|
public FmFund()
|
|
{
|
|
ProjectID = 0;//Ease.CoreV35.Model.ID.FromInteger(FM.BO.Common.User.CurrentMasterParam.ID.Integer);
|
|
Description = string.Empty;
|
|
Code = string.Empty;
|
|
UserObjectName = string.Empty;
|
|
}
|
|
#endregion
|
|
|
|
#region properties
|
|
#region Property ProjectID : ID
|
|
public int ProjectID { get; set; }
|
|
//private ID _projectID;
|
|
//public ID ProjectID
|
|
//{
|
|
// get { return _projectID; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<ID>("ProjectID", _projectID, value);
|
|
// _projectID = value;
|
|
// }
|
|
//}
|
|
|
|
#endregion Property ProjectID : ID
|
|
|
|
#region Property Description : string
|
|
public string Description { get; set; }
|
|
//private string _description;
|
|
//public string Description
|
|
//{
|
|
// get { return _description; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<string>("Description", _description, value);
|
|
// _description = value;
|
|
// }
|
|
//}
|
|
|
|
#endregion Property Description : string
|
|
|
|
#region Property Code : string
|
|
public string Code { get; set; }
|
|
//private string _code;
|
|
//public string Code
|
|
//{
|
|
// get { return _code; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<string>("Code", _code, value);
|
|
// _code = value;
|
|
// }
|
|
//}
|
|
|
|
#endregion Property Code : string
|
|
|
|
#region Property UserObjectName : string
|
|
public string UserObjectName { get; set; }
|
|
//private string _userObjectName;
|
|
//public string UserObjectName
|
|
//{
|
|
// get { return _userObjectName; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<string>("UserObjectName", _userObjectName, value);
|
|
// _userObjectName = value;
|
|
// }
|
|
//}
|
|
|
|
#endregion Property UserObjectName : string
|
|
|
|
#endregion
|
|
|
|
#region IDisplayProperty Members
|
|
|
|
//public string Column1
|
|
//{
|
|
// get { return this.Code; }
|
|
//}
|
|
|
|
//public string Column2
|
|
//{
|
|
// get { return this.Description; }
|
|
//}
|
|
|
|
//public string Column3
|
|
//{
|
|
// get { return string.Empty; }
|
|
//}
|
|
|
|
//public int Column4
|
|
//{
|
|
// get { return this.ID; }
|
|
//}
|
|
|
|
//public List<IDisplayProperty> GetMe()
|
|
//{
|
|
// List<IDisplayProperty> disps = null;
|
|
// ObjectsTemplate<Fund> lnCats = Service.Get();
|
|
// if (lnCats != null)
|
|
// {
|
|
// disps = new List<IDisplayProperty>();
|
|
// foreach (Fund lnCat in lnCats)
|
|
// {
|
|
// disps.Add(lnCat);
|
|
// }
|
|
// }
|
|
// return disps;
|
|
//}
|
|
|
|
//public List<IDisplayProperty> GetMe(ID id)
|
|
//{
|
|
// List<IDisplayProperty> disps = null;
|
|
// Fund lnCat = Service.Get(id);
|
|
// if (lnCat != null)
|
|
// {
|
|
// disps = new List<IDisplayProperty>();
|
|
// disps.Add(lnCat);
|
|
// }
|
|
// return disps;
|
|
//}
|
|
|
|
#endregion
|
|
|
|
#region Function
|
|
|
|
//public void Save()
|
|
//{
|
|
// try
|
|
// {
|
|
// base.SetAuditTrailProperties(GlobalFunctions.GetServerDate().Date, User.CurrentUser.ID);
|
|
// Service.Save(this);
|
|
|
|
// //Clear Cache
|
|
// CacheInfo.ClearCache(typeof(Fund).FullName);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public Fund Get(ID id)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// Fund fund = _cache["Get", id] as Fund;
|
|
|
|
// if (fund != null)
|
|
// return fund;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// fund = Service.Get(id);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(fund, "Get", id);
|
|
|
|
// #endregion
|
|
|
|
// return fund;
|
|
//}
|
|
|
|
//public static List<Fund> Get()
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// ObjectsTemplate<Fund> funds = _cache["Get"] as ObjectsTemplate<Fund>;
|
|
// if (funds != null)
|
|
// return funds;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// funds = Service.Get();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(funds, "Get");
|
|
|
|
// #endregion
|
|
|
|
// return funds;
|
|
//}
|
|
|
|
//public static List<Fund> GetByProjectID(ID projectID)
|
|
//{
|
|
// List<Fund> funds = new List<Fund>();
|
|
// try
|
|
// {
|
|
// funds = Service.GetByProjectID(projectID);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// return funds;
|
|
//}
|
|
|
|
//public static DataTable GetTable()
|
|
//{
|
|
// try
|
|
// {
|
|
// return Service.GetTable();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public void Delete(int fundID)
|
|
//{
|
|
// try
|
|
// {
|
|
// Service.Delete(fundID);
|
|
|
|
// //Clear Cache
|
|
// CacheInfo.ClearCache(typeof(Fund).FullName);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
#endregion
|
|
}
|
|
|
|
#endregion
|
|
|
|
public interface IFundService
|
|
{
|
|
void Save(FmFund fund);
|
|
void Delete(int fundID);
|
|
List<FmFund> GetByProjectID(int projectID);
|
|
FmFund Get(int fundID);
|
|
DataTable GetTable();
|
|
List<FmFund> Get();
|
|
|
|
}
|
|
}
|