457 lines
12 KiB
C#
457 lines
12 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Data;
|
|
using Ease.Core;
|
|
using Ease.CoreV35;
|
|
using Ease.Core.Utility;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region Class LoanCustomer
|
|
[Serializable]
|
|
public class LoanCustomer : AuditTrailBase
|
|
{
|
|
Member _member = new Member();
|
|
|
|
#region Constructor
|
|
|
|
public LoanCustomer()
|
|
{
|
|
AccNo = string.Empty;
|
|
Address = string.Empty;
|
|
DateOfBirth = DateTime.MinValue;
|
|
DateOfJoining = DateTime.MinValue;
|
|
EmpCode = string.Empty;
|
|
IsMember = false;
|
|
MemberShipNo = string.Empty;
|
|
Name = string.Empty;
|
|
MemberID = 0;
|
|
MembershipDate = DateTime.MinValue;
|
|
ProjectID = 0;//Ease.CoreV35.Model.ID.FromInteger(FM.BO.Common.User.CurrentMasterParam.ID.Integer);
|
|
Email = string.Empty;
|
|
}
|
|
|
|
public LoanCustomer(Member member)
|
|
{
|
|
_member = member;
|
|
AccNo = null;
|
|
Address = null;
|
|
DateOfBirth = _member.DOB;
|
|
DateOfJoining = _member.DOJ;
|
|
EmpCode = _member.EmpCode;
|
|
IsMember = true;
|
|
MemberShipNo = _member.MembershipNo;
|
|
Name = _member.Name;
|
|
MemberID = _member.ID;
|
|
ProjectID = _member.ProjectID;
|
|
if (_member.MembershipDate.HasValue)
|
|
{
|
|
MembershipDate = _member.MembershipDate.Value;
|
|
}
|
|
Email = member.Email;
|
|
}
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
#region Property AccNo : string
|
|
public string AccNo { get; set; }
|
|
//private string _accNo;
|
|
//public string AccNo
|
|
//{
|
|
// get { return _accNo; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<string>("AccNo", _accNo, value);
|
|
// _accNo = value;
|
|
// }
|
|
//}
|
|
|
|
#endregion Property AccNo : string
|
|
|
|
#region Property Address : string
|
|
public string Address { get; set; }
|
|
//private string _address;
|
|
//public string Address
|
|
//{
|
|
// get { return _address; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<string>("Address", _address, value);
|
|
// _address = value;
|
|
// }
|
|
//}
|
|
|
|
#endregion Property Address : string
|
|
|
|
#region Property MembershipDate : DateTime
|
|
public DateTime? MembershipDate { get; set; }
|
|
//private DateTime? _membershipDate;
|
|
//public DateTime? MembershipDate
|
|
//{
|
|
// get { return _membershipDate; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<DateTime>("MembershipDate", _membershipDate, value);
|
|
// if (_member != null && _member.MembershipDate.HasValue)
|
|
// {
|
|
// _membershipDate = _member.MembershipDate.Value;
|
|
// }
|
|
// else
|
|
// {
|
|
// _membershipDate = value;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
#endregion Property MembershipDate : DateTime
|
|
|
|
#region Property DateOfBirth : DateTime
|
|
public DateTime DateOfBirth { get; set; }
|
|
//private DateTime _dateOfBirth;
|
|
//public DateTime DateOfBirth
|
|
//{
|
|
// get { return _dateOfBirth; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<DateTime>("DateOfBirth", _dateOfBirth, value);
|
|
// if (_member != null && _member.DOB!=DateTime.MinValue)
|
|
// {
|
|
// _dateOfBirth = _member.DOB;
|
|
// }
|
|
// else
|
|
// {
|
|
// _dateOfBirth = value;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
#endregion Property DateOfBirth : DateTime
|
|
|
|
#region Property DateOfJoining : DateTime
|
|
public DateTime DateOfJoining { get; set; }
|
|
//private DateTime _dateOfJoining;
|
|
//public DateTime DateOfJoining
|
|
//{
|
|
// get { return _dateOfJoining; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<DateTime>("DateOfJoining", _dateOfJoining, value);
|
|
// if (_member != null && _member.DOJ!=DateTime.MinValue)
|
|
// {
|
|
// _dateOfJoining = _member.DOJ;
|
|
// }
|
|
// else
|
|
// {
|
|
// _dateOfJoining = value;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
#endregion Property DateOfJoining : DateTime
|
|
|
|
#region Property EmpCode : string
|
|
public string EmpCode { get; set; }
|
|
//private string _empCode;
|
|
//public string EmpCode
|
|
//{
|
|
// get { return _empCode; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<string>("EmpCode", _empCode, value);
|
|
// if (_member != null && !_member.ID.IsUnassigned)
|
|
// {
|
|
// _empCode = _member.EmpCode;
|
|
// }
|
|
// else
|
|
// {
|
|
// _empCode = value;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
#endregion Property EmpCode : string
|
|
|
|
#region Property IsMember : bool
|
|
public bool IsMember { get; set; }
|
|
//private bool _isMember;
|
|
//public bool IsMember
|
|
//{
|
|
// get { return _isMember; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<bool>("IsMember", _isMember, value);
|
|
|
|
// _isMember = value;
|
|
// }
|
|
//}
|
|
|
|
#endregion Property IsMember : bool
|
|
|
|
#region Property MemberShipNo : string
|
|
public string MemberShipNo { get; set; }
|
|
//private string _memberShipNo;
|
|
//public string MemberShipNo
|
|
//{
|
|
// get { return _memberShipNo; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<string>("MemberShipNo", _memberShipNo, value);
|
|
// if (_member != null && !_member.ID.IsUnassigned)
|
|
// {
|
|
// _memberShipNo = _member.MembershipNo;
|
|
// }
|
|
// else
|
|
// {
|
|
// _memberShipNo = value;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
#endregion Property MemberShipNo : string
|
|
|
|
#region Property Name : string
|
|
public string Name { get; set; }
|
|
//private string _name;
|
|
//public string Name
|
|
//{
|
|
// get { return _name; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<string>("Name", _name, value);
|
|
// if (_member != null && !_member.ID.IsUnassigned)
|
|
// {
|
|
// _name = _member.Name;
|
|
// }
|
|
// else
|
|
// {
|
|
// _name = value;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
#endregion Property Name : string
|
|
|
|
#region Property MemberID : ID
|
|
public int MemberID { get; set; }
|
|
//private ID _memberID;
|
|
//public ID MemberID
|
|
//{
|
|
// get { return _memberID; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<ID>("MemberID", _memberID, value);
|
|
// if (_member != null && !_member.ID.IsUnassigned)
|
|
// {
|
|
// _memberID = _member.ID;
|
|
// }
|
|
// else
|
|
// {
|
|
// _memberID = value;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
#endregion Property MemberID : ID
|
|
|
|
#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);
|
|
// if (_member != null && !_member.ID.IsUnassigned)
|
|
// {
|
|
// _projectID = _member.ProjectID;
|
|
// }
|
|
// else
|
|
// {
|
|
// _projectID = value;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
#endregion Property ProjectID : ID
|
|
|
|
#region Property Email : string
|
|
public string Email { get; set; }
|
|
//private string _email;
|
|
//public string Email
|
|
//{
|
|
// get { return _email; }
|
|
// set
|
|
// {
|
|
// base.OnPropertyChange<string>("Email", _email, value);
|
|
// _email = value;
|
|
// }
|
|
//}
|
|
|
|
#endregion Property Email : string
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
//#region Function
|
|
//public bool IsExist(ID memberID)
|
|
//{
|
|
// try
|
|
// {
|
|
// return Service.IsExist(memberID);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public void Save()
|
|
//{
|
|
// try
|
|
// {
|
|
// base.SetAuditTrailProperties(GlobalFunctions.GetServerDate().Date, User.CurrentUser.ID);
|
|
// Service.Save(this);
|
|
|
|
// //Clear Cache
|
|
// CacheInfo.ClearCache(typeof(LoanCustomer).FullName);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public LoanCustomer Get(ID id)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// LoanCustomer loanCustomer = _cache["Get", id] as LoanCustomer;
|
|
|
|
// if (loanCustomer != null)
|
|
// return loanCustomer;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// loanCustomer = Service.Get(id);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(loanCustomer, "Get", id);
|
|
|
|
// #endregion
|
|
|
|
// return loanCustomer;
|
|
//}
|
|
|
|
//public LoanCustomer GetByMemberID(ID id)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// LoanCustomer loanCustomer = _cache["GetByMemberID", id] as LoanCustomer;
|
|
|
|
// if (loanCustomer != null)
|
|
// return loanCustomer;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// loanCustomer = Service.GetByMemberID(id);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(loanCustomer, "GetByMemberID", id);
|
|
|
|
// #endregion
|
|
|
|
// return loanCustomer;
|
|
//}
|
|
|
|
//public static ObjectsTemplate<LoanCustomer> Get()
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// ObjectsTemplate<LoanCustomer> loanCustomers = _cache["Get"] as ObjectsTemplate<LoanCustomer>;
|
|
// if (loanCustomers != null)
|
|
// return loanCustomers;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// loanCustomers = Service.Get();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(loanCustomers, "Get");
|
|
|
|
// #endregion
|
|
|
|
|
|
// return loanCustomers;
|
|
//}
|
|
|
|
//public static DataTable GetTable()
|
|
//{
|
|
// try
|
|
// {
|
|
// return Service.GetTable();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public void Delete(ID loanCustomerID)
|
|
//{
|
|
// try
|
|
// {
|
|
// Service.Delete(loanCustomerID);
|
|
|
|
// //Clear Cache
|
|
// CacheInfo.ClearCache(typeof(LoanCustomer).FullName);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//#endregion
|
|
}
|
|
#endregion
|
|
|
|
public interface ILoanCustomerService
|
|
{
|
|
void Save(LoanCustomer loanCustomer);
|
|
void Delete(int loanCustomerID);
|
|
LoanCustomer Get(int loanCustomerID);
|
|
LoanCustomer GetByMemberID(int memberID);
|
|
DataTable GetTable();
|
|
List<LoanCustomer> Get();
|
|
bool IsExist(int memberID);
|
|
}
|
|
}
|