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 LoanSettlement public class LoanSettlement : AuditTrailBase { #region Constructor public LoanSettlement() { //_loanIssueID = null; //_settledAmount = 0; //_bankID = null; //_branchID = null; //_chequeNo = string.Empty; //_accountNo = string.Empty; //_submitDate = DateTime.MinValue; //_remarks = string.Empty; //_wfStatus = enumwfStatus.Not_yet_Submitted; } #endregion #region Properties public int LoanIssueID { get; set; } public EnumwfStatus WFStatus { get; set; } public double SettledAmount { get; set; } public int BankID { get; set; } public int BranchID { get; set; } public string ChequeNo { get; set; } public string AccountNo { get; set; } public DateTime SubmitDate { get; set; } public string Remarks { get; set; } public int SetupID { get { return 2; } } public int ObjectID { get { return this.ID; } } public Employee Employee { get; set; } //#region employee : Employee //private Employee _employee; //public Employee Employee //{ // get // { // if (_loanIssueID.Integer > 0 ) // { // LoanIssue ls = LoanIssue.Get(_loanIssueID); // _employee = new Employee(); // _employee = Employee.Get(ls.EmployeeID); // } // return this._employee; // } // set // { // _employee = value; // } //} public Loan LoanObj { get; set; } //#region loan : Loan //private Loan _loan; //public Loan LoanObj //{ // get // { // if (_loanIssueID.Integer > 0) // { // LoanIssue ls = LoanIssue.Get(_loanIssueID); // _loan = Loan.Get(ls.LoanID); // } // return this._loan; // } // set // { // _loan = value; // } //} //#endregion //#endregion #endregion //public string WFDesciption() //{ // return this.ObjectDescription; //} //public int GetStatusbyWf(enumwfStatus wfstatus) //{ // return (int)this.WFStatus; //} //public string ObjectDescription //{ // get // { // string str = ""; // str = " Employee (" + this.Employee.EmployeeNo + ")" + this.Employee.Name // + " applied for the settlement of " + this.LoanObj.Name + " Loan. "; // return str; // } //} //public List GetDetails() //{ // List opJobsDetail = new List(); // opJobsDetail.Add(new PendingJobDetail() { Type = "Applier:", Value = this.Employee.Name }); // opJobsDetail.Add(new PendingJobDetail() { Type = "Loan Type:", Value = this.LoanObj.Name }); // opJobsDetail.Add(new PendingJobDetail() { Type = "Sumbit Date:", Value = this.SubmitDate.ToString("dd MMM yyyy") }); // opJobsDetail.Add(new PendingJobDetail() { Type = "Settlement Amount:", Value = this.SettledAmount.ToString("#,###") }); // if (this.BranchID != null) // { // Branch brnc = Branch.Get(this.BranchID); // if (brnc != null) // { // opJobsDetail.Add(new PendingJobDetail() { Type = "Bank:", Value = brnc.Bank.Name }); // opJobsDetail.Add(new PendingJobDetail() { Type = "Branch:", Value = brnc.Name }); // } // } // opJobsDetail.Add(new PendingJobDetail() { Type = "Checque No:", Value = this.ChequeNo }); // opJobsDetail.Add(new PendingJobDetail() { Type = "Account No:", Value = this.AccountNo }); // return opJobsDetail; //} //#region Service Factory ILoanSettlementService : ILoanSettlementService //internal static ILoanSettlementService Service //{ // get { return Services.Factory.CreateService(typeof(ILoanSettlementService)); } //} //#endregion //#region Functions //public static LoanSettlement Get(ID nID) //{ // LoanSettlement oLoanSettlement = null; // #region Cache Header // oLoanSettlement = (LoanSettlement)_cache["Get", nID]; // if (oLoanSettlement != null) // return oLoanSettlement; // #endregion // oLoanSettlement = LoanSettlement.Service.Get(nID); // #region Cache Footer // _cache.Add(oLoanSettlement, "Get", nID); // #endregion // return oLoanSettlement; //} //public static List Get() //{ // #region Cache Header // List loanSettlements = _cache["Get"] as List; // if (loanSettlements != null) // return loanSettlements; // #endregion // try // { // loanSettlements = Service.Get(); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(loanSettlements, "Get"); // #endregion // return loanSettlements; //} //public ID Save() //{ // base.SetAuditTrailProperties(); // return LoanSettlement.Service.Save(this); //} //public void Delete() //{ // LoanSettlement.Service.Delete(ID); //} //#endregion } #endregion //#region ILoanSettlementService Service //public interface ILoanSettlementService //{ // LoanSettlement Get(ID id); // List Get(); // ID Save(LoanSettlement item); // void Delete(ID id); //} //#endregion }