EchoTex_Payroll/HRM.BO/Budget/BudgetNewJoiner.cs

519 lines
12 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
using Ease.Core.Model;
using System;
using System.Collections.Generic;
using System.Data;
namespace HRM.BO
{
#region class BudgetNewJoiner
public class BudgetNewJoiner : ObjectTemplate
{
#region Constructor
public BudgetNewJoiner()
{
_basicSalary = 0;
_budgetID = 0;
_departmentID = 0;
_categoryID = 0;
_gradeID = 0;
_incrementPercentage = 0;
_locationID = 0;
_nextIncrementalMonth = 0;
_noofEmployee = 0;
_fromDate = DateTime.MinValue;
_grossSalary = 0;
#region Child Variables
OBudgetNewJoinerCrGs = null;
#endregion
}
#endregion
#region Properties
#region Parent Properties
#region BasicSalary : double
private double _basicSalary;
public double BasicSalary
{
get { return _basicSalary; }
set { _basicSalary = value; }
}
#endregion
#region GrossSalary : double
private double _grossSalary;
public double GrossSalary
{
get { return _grossSalary; }
set { _grossSalary = value; }
}
#endregion
#region BudgetID : ID
private int _budgetID;
public int BudgetID
{
get { return _budgetID; }
set { _budgetID = value; }
}
#endregion
#region DepartmentID : ID
private int _departmentID;
public int DepartmentID
{
get { return _departmentID; }
set { _departmentID = value; }
}
#endregion
#region GradeID : ID
private int _gradeID;
public int GradeID
{
get { return _gradeID; }
set { _gradeID = value; }
}
#endregion
#region CategoryID : ID
private int _categoryID;
public int CategoryID
{
get { return _categoryID; }
set { _categoryID = value; }
}
#endregion
#region IncrementPercentage : double
private double _incrementPercentage;
public double IncrementPercentage
{
get { return _incrementPercentage; }
set { _incrementPercentage = value; }
}
#endregion
#region LocationID : ID
private int _locationID;
public int LocationID
{
get { return _locationID; }
set { _locationID = value; }
}
#endregion
#region NextIncrementalMonth : int
private int _nextIncrementalMonth;
public int NextIncrementalMonth
{
get { return _nextIncrementalMonth; }
set { _nextIncrementalMonth = value; }
}
#endregion
#region NoofEmployee : int
private int _noofEmployee;
public int NoofEmployee
{
get { return _noofEmployee; }
set { _noofEmployee = value; }
}
#endregion
//public Grade Grade { get; set; }
//public Department Department { get; set; }
//public Location Location { get; set; }
//public Category Category { get; set; }
//#region grade : Grade
//private Grade _grade;
//public Grade Grade
//{
// get
// {
// if (_gradeID != null && !_gradeID.IsUnassigned)
// {
// if (_gradeID.Integer > 0 && _grade == null)
// {
// _grade = new Grade();
// _grade = Grade.Get(_gradeID);
// }
// }
// return this._grade;
// }
// set
// {
// _grade = value;
// }
//}
//#endregion
//#region department : Department
//private Department _department;
//public Department Department
//{
// get
// {
// if (_departmentID != null && !_departmentID.IsUnassigned)
// {
// if (_departmentID.Integer > 0 && _department == null)
// {
// _department = new Department();
// _department = Department.Get(_departmentID);
// }
// }
// return this._department;
// }
// set
// {
// _department = value;
// }
//}
//#endregion
//#region location : Location
//private Location _location;
//public Location Location
//{
// get
// {
// if (_locationID != null && !_locationID.IsUnassigned)
// {
// if (_locationID.Integer > 0 && _location == null)
// {
// _location = new Location();
// _location = Location.Get(_locationID);
// }
// }
// return this._location;
// }
// set
// {
// _location = value;
// }
//}
//#endregion
//#region location : Location
//private Category _category;
//public Category Category
//{
// get
// {
// if (_categoryID != null && !_categoryID.IsUnassigned)
// {
// if (_categoryID.Integer > 0 && _category == null)
// {
// _category = new Category();
// _category = Category.Get(_categoryID);
// }
// }
// return this._category;
// }
// set
// {
// _category = value;
// }
//}
//#endregion
#region FromDate : DateTime
private DateTime _fromDate;
public DateTime FromDate
{
get { return _fromDate; }
set { _fromDate = value; }
}
#endregion
#endregion
#region Child Properties
public List<BudgetNewJoinerCrG> OBudgetNewJoinerCrGs { get; set; }
//#region BudgetNewJoinerCrG Property
//private List<BudgetNewJoinerCrG> _oBudgetNewJoinerCrGs;
//public List<BudgetNewJoinerCrG> OBudgetNewJoinerCrGs
//{
// get
// {
// if (_oBudgetNewJoinerCrGs == null)
// {
// _oBudgetNewJoinerCrGs = new List<BudgetNewJoinerCrG>();
// if (!this.ID.IsUnassigned)
// _oBudgetNewJoinerCrGs = BudgetNewJoiner.Service.GetBudgetNewJoinerCrGs(base.ID);
// }
// return _oBudgetNewJoinerCrGs;
// }
// set { _oBudgetNewJoinerCrGs = value; }
//}
//#endregion
#endregion
//#region Service Factory IBudgetNewJoinerService : IBudgetNewJoinerService
//internal static IBudgetNewJoinerService Service
//{
// get { return Services.Factory.CreateService<IBudgetNewJoinerService>(typeof(IBudgetNewJoinerService)); }
//}
//#endregion
#endregion
public Employee CreateEmployee(int joinerCount)
{
Employee oEmp = new Employee();
oEmp.Name = joinerCount.ToString();
oEmp.GradeID = this.GradeID;
oEmp.DepartmentID = this.DepartmentID;
oEmp.DepartmentID = this.DepartmentID;
oEmp.CategoryID = this.CategoryID;
oEmp.JoiningDate = _fromDate;
oEmp.BasicSalary = this.BasicSalary;
oEmp.GrossSalary = this.GrossSalary;
return oEmp;
}
//#region Function(s)
//#region Get
//public static BudgetNewJoiner Get(int nID)
//{
// BudgetNewJoiner oBudgetNewJoiner = null;
// #region Cache Header
// oBudgetNewJoiner = (BudgetNewJoiner)_cache["Get", nID];
// if (oBudgetNewJoiner != null)
// return oBudgetNewJoiner;
// #endregion
// try
// {
// oBudgetNewJoiner = Service.Get(nID);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(oBudgetNewJoiner, "Get", nID);
// #endregion
// return oBudgetNewJoiner;
//}
//public static List<BudgetNewJoiner> Get()
//{
// #region Cache Header
// List<BudgetNewJoiner> oBudgetNewJoiners = _cache["Get"] as List<BudgetNewJoiner>;
// if (oBudgetNewJoiners != null)
// return oBudgetNewJoiners;
// #endregion
// try
// {
// oBudgetNewJoiners = Service.Get();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(oBudgetNewJoiners, "Get");
// #endregion
// return oBudgetNewJoiners;
//}
//public static List<BudgetNewJoiner> Get(int nBudID)
//{
// #region Cache Header
// List<BudgetNewJoiner> oBudgetNewJoiners = _cache["Get"] as List<BudgetNewJoiner>;
// if (oBudgetNewJoiners != null)
// return oBudgetNewJoiners;
// #endregion
// try
// {
// oBudgetNewJoiners = Service.Get(nBudID);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(oBudgetNewJoiners, "Get");
// #endregion
// return oBudgetNewJoiners;
//}
//#endregion
//#region Save
//public int Save()
//{
// //SetAuditTrailProperties();
// return Service.Save(this);
//}
//#endregion
//#region Delete
//public void Delete(int id)
//{
// Service.Delete(id);
//}
//#endregion
//#endregion
}
#endregion
#region Child Object(s)
public class BudgetNewJoinerCrG : BasicBaseObject
{
#region Constructor
public BudgetNewJoinerCrG()
{
_cCID = 0;
_budgetNewJoinerID = 0;
_percentage = 0;
}
#endregion
#region Properties
#region BudgetNewJoinerID : ID
private int _budgetNewJoinerID;
public int BudgetNewJoinerID
{
get { return _budgetNewJoinerID; }
set { _budgetNewJoinerID = value; }
}
#endregion
#region CCID : ID
private int _cCID;
public int CCID
{
get { return _cCID; }
set { _cCID = value; }
}
#endregion
#region Percentage : double
private double _percentage;
public double Percentage
{
get { return _percentage; }
set { _percentage = value; }
}
#endregion
//public Costcenter CC { get; set; }
//#region Costcenter : CC
//private Costcenter _CC;
//public Costcenter CC
//{
// get
// {
// if (_cCID.IsUnassigned == false && _cCID.Integer > 0 && _CC == null)
// {
// _CC = new Costcenter();
// _CC = Costcenter.Get(_cCID);
// }
// return this._CC;
// }
// set
// {
// _CC = value;
// }
//}
//#endregion
#endregion
}
#endregion
#region IBudgetNewJoinerService
public interface IBudgetNewJoinerService
{
BudgetNewJoiner Get(int nID);
List<BudgetNewJoiner> Get();
List<BudgetNewJoiner> GetWithBudgetID(int nBudID);
int Save(BudgetNewJoiner item);
void Delete(int nID);
List<BudgetNewJoinerCrG> GetBudgetNewJoinerCrGs(int baseID);
}
#endregion
}