EchoTex_Payroll/HRM.BO/Fund/Investment/InvestmentSchedule.cs

252 lines
5.8 KiB
C#
Raw Normal View History

2024-10-14 10:01:49 +06:00
using System;
using System.Linq;
using System.Data;
using System.Collections.Generic;
namespace HRM.BO
{
public class InvestmentSchedule : AuditTrailBase
{
#region Constructor
public InvestmentSchedule()
: base()
{
FromDate = DateTime.MinValue;
InvestmentID = 0;
ProjectID = 0;
Percentage = 0;
RecalculationNeeded = false;
TillDate = DateTime.MinValue;
TranDate = DateTime.MinValue;
ViewState = true;
SerialNo = 0;
}
#endregion Constructor
#region Properties
#region Property InvestmentID : ID
public int InvestmentID
{
get;set;
}
#endregion Property InvestmentID : ID
#region Property ProjectID : ID
public int ProjectID
{
get; set;
}
#endregion Property ProjectID : ID
#region Property Percentage : double
public double Percentage
{
get; set;
}
#endregion Property Percentage : double
#region Property ViewState : bool
public bool ViewState
{
get; set;
}
#endregion Property ViewState : bool
#region Property RecalculationNeeded : bool
public bool RecalculationNeeded
{
get; set;
}
#endregion Property RecalculationNeeded : bool
#region Property FromDate : DateTime
public DateTime FromDate
{
get; set;
}
#endregion Property FromDate : DateTime
#region Property TillDate : DateTime
public DateTime TillDate
{
get; set;
}
#endregion Property TillDate : DateTime
#region Property TranDate : DateTime
public DateTime TranDate
{
get; set;
}
#endregion Property TranDate : DateTime
#region Property SerialNo : int
public int SerialNo
{
get; set;
}
#endregion
#endregion Properties
//#region Service Factory IInvestmentScheduleService : IInvestmentScheduleService
//internal static IInvestmentScheduleService Service
//{
// get { return Services.Factory.CreateService<IInvestmentScheduleService>(typeof(IInvestmentScheduleService)); }
//}
//#endregion
//#region Function
//public void Save()
//{
// try
// {
// //base.SetAuditTrailProperties();
// Service.Save(this);
// //Clear Cache
// CacheInfo.ClearCache(typeof(InvestmentSchedule).FullName);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
//}
//public InvestmentSchedule Get(ID id)
//{
// #region Cache Header
// InvestmentSchedule investmentSchedule = _cache["Get", id] as InvestmentSchedule;
// if (investmentSchedule != null)
// return investmentSchedule;
// #endregion
// try
// {
// investmentSchedule = Service.Get(id);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(investmentSchedule, "Get", id);
// #endregion
// return investmentSchedule;
//}
//public static List<InvestmentSchedule> Get()
//{
// #region Cache Header
// List<InvestmentSchedule> investmentSchedules = _cache["Get"] as List<InvestmentSchedule>;
// if (investmentSchedules != null)
// return investmentSchedules;
// #endregion
// try
// {
// investmentSchedules = Service.Get();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(investmentSchedules, "Get");
// #endregion
// return investmentSchedules;
//}
//public static DataTable GetTable()
//{
// try
// {
// return Service.GetTable();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
//}
//public void Delete(ID investmentScheduleID)
//{
// try
// {
// Service.Delete(investmentScheduleID);
// //Clear Cache
// CacheInfo.ClearCache(typeof(InvestmentSchedule).FullName);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
//}
//#endregion Function
}
#region Class InvestmentSchedules
public class InvestmentSchedules : List<InvestmentSchedule>
{
#region Constructor
public InvestmentSchedules()
{
}
#endregion
public InvestmentSchedule GetItemByInvestmentSchedule(int investmentScheduleID)
{
return this.Find(delegate (InvestmentSchedule item) { return item.ID == investmentScheduleID; });
}
}
#endregion
public interface IInvestmentScheduleService
{
void Save(InvestmentSchedule investmentSchedule);
void Delete(int investmentScheduleID);
InvestmentSchedule Get(int investmentScheduleID);
DataTable GetTable();
List<InvestmentSchedule> Get();
}
}