using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.Core; using Ease.Core.Model; using System.Data; namespace HRM.BO { #region Loan public class Loan : BasicBaseObject { #region Constructor public Loan() { Name = string.Empty; NameInBangla = string.Empty; //_isConfirmationRequired = false; InterestRate = 0; LoanGroup = EnumLoanGroup.General_Loan; _status = EnumStatus.Active; this.calculationType = EnumLoanFraction.WithFraction; } #endregion #region Input validator public string[] InputValidator() { string[] sErrorString = new string[2]; if (this.Name == "") { sErrorString[0] = "Name can not be empty"; sErrorString[1] = "Name"; return sErrorString; } sErrorString = null; return sErrorString; } #endregion #region Properties public string Name { get; set; } public string NameInBangla { get; set; } public EnumLoanGroup LoanGroup { get; set; } public int PayrollTypeID { get; set; } public bool IsConfirmationRequired { get; set; } public double InterestRate { get; set; } public EnumLoanFraction calculationType { get; set; } //#region Service Factory ILoanService : ILoanService //internal static ILoanService Service //{ // get { return Services.Factory.CreateService(typeof(ILoanService)); } //} //#endregion #endregion //#region Functions //public static Loan Get(ID nID) //{ // Loan oLoan = null; // #region Cache Header // oLoan = (Loan)_cache["Get", nID]; // if (oLoan != null) // return oLoan; // #endregion // oLoan = Loan.Service.Get(nID); // #region Cache Footer // _cache.Add(oLoan, "Get", nID); // #endregion // return oLoan; //} //public static List Get(EnumStatus status) //{ // #region Cache Header // List loans = _cache["Get",status] as List; // if (loans != null) // return loans; // #endregion // try // { // loans = Service.Get(status); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(loans, "Get",status); // #endregion // return loans; //} //public ID Save() //{ // this.SetAuditTrailProperties(); // return Loan.Service.Save(this); //} //public void Delete(ID id) //{ // Loan.Service.Delete(id); //} //#endregion //public static Loan Get(string loanNo) //{ // Loan oLoan = null; // #region Cache Header // oLoan = (Loan)_cache["Get", loanNo]; // if (oLoan != null) // return oLoan; // #endregion // oLoan = Loan.Service.Get(loanNo); // #region Cache Footer // _cache.Add(oLoan, "Get", loanNo); // #endregion // return oLoan; //} } #endregion #region ILoan Service public interface ILoanService { Loan Get(int id); List Get(EnumStatus status); int Save(Loan item); void Delete(int id); Loan Get(string loanNo); } #endregion }