using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35; using Ease.CoreV35.Model; using Ease.CoreV35.Caching; using System.Data.Linq.Mapping; using System.Data; namespace Payroll.BO { #region CarFuelParameter [Serializable] public class CarFuelParameter : BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(CarFuelParameter)); #endregion #region Constructor public CarFuelParameter() { _amountToDistribute = 0.0; _avgMonth = 0; _flatAmount = 0.0; _provisionAmount = 0.0; _fromDate = DateTime.Now; _toDate = DateTime.Now; _gender = EnumGender.None; _isActive = false; _isEarnedBasic = false; _isTaxable = false; _isConfirmed = false; _isWithException = false; _minAmount = 0.0; _maxAmount = 0.0; _isFractionate = false; _CarFuelItemID = null; _CarFuelParameterGrades = null; _CarFuelParameterIndividuals = null; _CarFuelPeriodicity = EnumCarFuelPeriodicity.OnceOff; _CarFuelType = EnumCarFuelType.Provision; _percentOfBasic = 0.0; _percentOfGross = 0.0; _entitleType = EnumEntitleType.Grade; _CarFuelAvgPayType = EnumCarFuelAvgPayType.NONE; _CarFuelAvgPayItemID = null; _nNoOfMonth = 0; _payrollTypeID = SystemInformation.CurrentSysInfo.PayrollTypeID; } #endregion #region Properties #region CarFuelType : EnumCarFuelType private EnumCarFuelType _CarFuelType; public EnumCarFuelType CarFuelType { get { return _CarFuelType; } set { base.OnPropertyChange("CarFueltype", (short)_CarFuelType, (short)value); _CarFuelType = value; } } #endregion #region AmountToDistribute : double private double _amountToDistribute; public double AmountToDistribute { get { return _amountToDistribute; } set { base.OnPropertyChange("amounttodistribute", _amountToDistribute, value); _amountToDistribute = value; } } #endregion #region AvgMonth : int private int _avgMonth; public int AvgMonth { get { return _avgMonth; } set { base.OnPropertyChange("avgmonth", _avgMonth, value); _avgMonth = value; } } #endregion #region payrollTypeID : ID private ID _payrollTypeID; public ID PayrollTypeID { get { return _payrollTypeID; } set { base.OnPropertyChange("payrollTypeID", _payrollTypeID, value); _payrollTypeID = value; } } #endregion #region ProvisionAmount : double private double _provisionAmount; public double ProvisionAmount { get { return _provisionAmount; } set { base.OnPropertyChange("ProvisionAmount", _provisionAmount, value); _provisionAmount = value; } } #endregion #region FlatAmount : double private double _flatAmount; public double FlatAmount { get { return _flatAmount; } set { base.OnPropertyChange("flatamount", _flatAmount, value); _flatAmount = value; } } #endregion #region MinAmount : double private double _minAmount; public double MinAmount { get { return _minAmount; } set { base.OnPropertyChange("minamount", _minAmount, value); _minAmount = value; } } #endregion #region MaxAmount : double private double _maxAmount; public double MaxAmount { get { return _maxAmount; } set { base.OnPropertyChange("maxamount", _maxAmount, value); _maxAmount = value; } } #endregion #region FromDate : DateTime private DateTime _fromDate; public DateTime FromDate { get { return _fromDate; } set { base.OnPropertyChange("fromdate", _fromDate, value); _fromDate = value; } } #endregion #region ToDate : DateTime private DateTime? _toDate; public DateTime? ToDate { get { return _toDate; } set { base.OnPropertyChange("todate", _toDate, value); _toDate = value; } } #endregion #region Gender : EnumGender private EnumGender _gender; public EnumGender Gender { get { return _gender; } set { base.OnPropertyChange("gender", (short)_gender, (short)value); _gender = value; } } #endregion #region IsActive : bool private bool _isActive; public bool IsActive { get { return _isActive; } set { base.OnPropertyChange("isactive", _isActive, value); _isActive = value; } } #endregion #region IsEarnedBasic : bool private bool _isEarnedBasic; public bool IsEarnedBasic { get { return _isEarnedBasic; } set { base.OnPropertyChange("isearnedbasic", _isEarnedBasic, value); _isEarnedBasic = value; } } #endregion #region IsTaxable : bool private bool _isTaxable; public bool IsTaxable { get { return _isTaxable; } set { base.OnPropertyChange("istaxable", _isTaxable, value); _isTaxable = value; } } #endregion #region IsConfirmed : bool private bool _isConfirmed; public bool IsConfirmed { get { return _isConfirmed; } set { base.OnPropertyChange("isconfirmed", _isConfirmed, value); _isConfirmed = value; } } #endregion #region IsFractionate : bool private bool _isFractionate; public bool IsFractionate { get { return _isFractionate; } set { base.OnPropertyChange("isfractionate", _isFractionate, value); _isFractionate = value; } } #endregion #region isWithException : bool private bool _isWithException; public bool IsWithException { get { return _isWithException; } set { base.OnPropertyChange("isWithException", _isWithException, value); _isWithException = value; } } #endregion #region CarFuelItemID : ID private ID _CarFuelItemID; public ID CarFuelItemID { get { return _CarFuelItemID; } set { base.OnPropertyChange("CarFuelitemid", _CarFuelItemID, value); _CarFuelItemID = value; } } #endregion #region CarFuelPeriodicity : EnumCarFuelPeriodicity private EnumCarFuelPeriodicity _CarFuelPeriodicity; public EnumCarFuelPeriodicity CarFuelPeriodicity { get { return _CarFuelPeriodicity; } set { base.OnPropertyChange("CarFuelperiodicity", (short)_CarFuelPeriodicity, (short)value); _CarFuelPeriodicity = value; } } #endregion #region PercentOfBasic : double private double _percentOfBasic; public double PercentOfBasic { get { return _percentOfBasic; } set { base.OnPropertyChange("percentofbasic", _percentOfBasic, value); _percentOfBasic = value; } } #endregion #region PercentOfGross : double private double _percentOfGross; public double PercentOfGross { get { return _percentOfGross; } set { base.OnPropertyChange("percentofgross", _percentOfGross, value); _percentOfGross = value; } } #endregion #region entitleType : EntitleType private EnumEntitleType _entitleType; public EnumEntitleType EntitleType { get { return _entitleType; } set { base.OnPropertyChange("entitletype", (short)_entitleType, (short)value); _entitleType = value; } } #endregion #region isFlatAmount : bool public bool IsFlatAmount { get { if (_flatAmount != 0) { return true; } return false; } } #endregion #region CarFuelAvgPayType : EnumCarFuelAvgPayType private EnumCarFuelAvgPayType _CarFuelAvgPayType; public EnumCarFuelAvgPayType CarFuelAvgPayType { get { return _CarFuelAvgPayType; } set { base.OnPropertyChange("CarFuelAvgPayType", (short)_CarFuelAvgPayType, (short)value); _CarFuelAvgPayType = value; } } #endregion #region CarFuelAvgPayItemID : ID private ID _CarFuelAvgPayItemID; public ID CarFuelAvgPayItemID { get { return _CarFuelAvgPayItemID; } set { base.OnPropertyChange("CarFuelAvgPayItemID", _CarFuelAvgPayItemID, value); _CarFuelAvgPayItemID = value; } } #endregion #region NoOfMonth : int private int _nNoOfMonth; public int NoOfMonth { get { return _nNoOfMonth; } set { base.OnPropertyChange("NoOfMonth", _nNoOfMonth, value); _nNoOfMonth = value; } } #endregion #region CarFuelParameterGrades : ObjectsTemplate private ObjectsTemplate _CarFuelParameterGrades; public ObjectsTemplate CarFuelParameterGrades { get { if (_CarFuelParameterGrades == null && !this.ID.IsUnassigned && this.ID.Integer > 0) { _CarFuelParameterGrades = CarFuelParameter.GetGrades(this.ID); } return this._CarFuelParameterGrades; } set { _CarFuelParameterGrades = value; } } #endregion #region CarFuelParameterIndividuals : ObjectsTemplate private ObjectsTemplate _CarFuelParameterIndividuals; public ObjectsTemplate CarFuelParameterIndividuals { get { if (_CarFuelParameterIndividuals == null && !this.ID.IsUnassigned && this.ID.Integer > 0) { _CarFuelParameterIndividuals = CarFuelParameterIndividual.GetByParameterID(this.ID); } else if (_CarFuelParameterIndividuals == null) { _CarFuelParameterIndividuals = new ObjectsTemplate(); } return this._CarFuelParameterIndividuals; } set { _CarFuelParameterIndividuals = value; } } #endregion #region CarFuelItem : CarFuelItem private CarFuelItem _CarFuelItem; public CarFuelItem CarFuelItem { get { if (_CarFuelItemID.Integer > 0 && _CarFuelItem == null) { _CarFuelItem = new CarFuelItem(); _CarFuelItem = CarFuelItem.Get(_CarFuelItemID); } return this._CarFuelItem; } set { _CarFuelItem = value; } } #endregion //#region NotApplicable : CarFuelParameterIndividual //private ObjectsTemplate _NotApplicable = null; //public ObjectsTemplate NotApplicable //{ // get // { // if (_NotApplicable == null && !this.ID.IsUnassigned && this.ID.Integer > 0) // { // _NotApplicable = CarFuelParameterIndividual.GetIndividuals(this.ID, EnumCarFuelIndivdualType.NotApplicable); // } // return this._NotApplicable; // } //} //#endregion #region NoOfAplicableEmp : int private int _noOfemployee; public int NoOfAplicableEmp { get { if (_noOfemployee <= 0) { string gradeIDs = string.Empty; foreach (CarFuelParameterGrade pGrade in this.CarFuelParameterGrades) { if (gradeIDs != string.Empty) gradeIDs += "," + pGrade.GradeId.ToString(); else gradeIDs += pGrade.GradeId.ToString(); } SearchManager om = new SearchManager(EnumSearchFrom.Employee); om.Parameter.Add(EnumSearchParameter.GradeID, EnumSQLOperator.In, EnumSearchObjDataType.String, gradeIDs); om.Parameter.Add(EnumSearchParameter.Status, (int)EnumEmployeeStatus.Live); //confirmed is selected om.Parameter.Add(EnumSearchParameter.Confirm, true); //if gender is selected om.Parameter.Add(EnumSearchParameter.Gender, (int)EnumGender.Male); ObjectsTemplate emps = om.Find(); _noOfemployee = emps.Count; } return _noOfemployee; } } #endregion #endregion #region Functions private int ApplicableEmp() { int nApplEmp = 0; //if (this.EntitleType == EnumEntitleType.Grade) //{ //} return nApplEmp; } public CarFuelParameter Get(ID nCarFuelParameterID) { CarFuelParameter oCarFuelParameter = null; #region Cache Header oCarFuelParameter = (CarFuelParameter)_cache["Get", nCarFuelParameterID]; if (oCarFuelParameter != null) return oCarFuelParameter; #endregion oCarFuelParameter = CarFuelParameter.Service.Get(nCarFuelParameterID,Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); #region Cache Footer _cache.Add(oCarFuelParameter, "Get", nCarFuelParameterID); #endregion return oCarFuelParameter; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate CarFuelParameters = _cache["Get"] as ObjectsTemplate; if (CarFuelParameters != null) return CarFuelParameters; #endregion try { CarFuelParameters = Service.Get(Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(CarFuelParameters, "Get"); #endregion return CarFuelParameters; } public static ObjectsTemplate GetGrades(ID CarFuelParameterID) { #region Cache Header ObjectsTemplate oGrades = _cache["Get", CarFuelParameterID] as ObjectsTemplate; if (oGrades != null) return oGrades; #endregion try { oGrades = Service.GetGrades(CarFuelParameterID,Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(oGrades, "Get", CarFuelParameterID); #endregion return oGrades; } public static ObjectsTemplate Get(EnumStatus status) { #region Cache Header ObjectsTemplate CarFuelParameters = _cache["Get", status] as ObjectsTemplate; if (CarFuelParameters != null) return CarFuelParameters; #endregion try { CarFuelParameters = Service.Get(status,Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(CarFuelParameters, "Get", status); #endregion return CarFuelParameters; } public static ObjectsTemplate Get(EnumStatus status, EnumCarFuelType type) { #region Cache Header ObjectsTemplate CarFuelParameters = _cache["Get", status, type] as ObjectsTemplate; if (CarFuelParameters != null) return CarFuelParameters; #endregion try { CarFuelParameters = Service.Get(status, type,Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(CarFuelParameters, "Get", status, type); #endregion return CarFuelParameters; } public ID Save() { this.SetAuditTrailProperties(); return CarFuelParameter.Service.Save(this,Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } public void Delete() { CarFuelParameter.Service.Delete(ID,Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } #region Exception : ADParameterEmployee private ObjectsTemplate _Exception = null; public ObjectsTemplate Exception { get { if (_Exception == null && !this.ID.IsUnassigned && this.ID.Integer > 0) { _Exception = CarFuelParameterIndividual.GetIndividuals(this.ID, EnumCarFuelIndivdualType.Exception); } return this._Exception; } } #endregion #region NotApplicable : ADParameterEmployee private ObjectsTemplate _NotApplicable = null; public ObjectsTemplate NotApplicable { get { if (_NotApplicable == null && !this.ID.IsUnassigned && this.ID.Integer > 0) { _NotApplicable = CarFuelParameterIndividual.GetIndividuals(this.ID, EnumCarFuelIndivdualType.NotApplicable); } return this._NotApplicable; } } #endregion public static List GetApplicableParameters(Employee employee, ID graId, ObjectsTemplate parameters) { List applicableParams = parameters.FindAll(delegate(CarFuelParameter param) { return IsApplicable(param, graId, employee); }); return applicableParams; } private static bool IsApplicable(CarFuelParameter param, ID graid, Employee employee) { bool isApplicable = false; foreach (CarFuelParameterGrade adgrade in param.CarFuelParameterGrades) { if (adgrade.GradeId.Integer == graid.Integer) { isApplicable = true; } } if (!isApplicable) return false; if (param.Gender != EnumGender.None && param.Gender != employee.Gender) { return false; } //if (param.IsForConfirmOnly && !employee.IsConfirmed) //{ // return false; //} return true; } /// /// /// /// /// /// /// public double GetGradeDefinedAmount(Employee employee, ObjectsTemplate gradeSalarires) { double nAmount = 0; foreach (EmployeeGradeSalary item in gradeSalarires) { nAmount = nAmount + this.GetGradeDefinedAmount(employee, item.BasicSalary, item.GrossSalary, item.FractionofFromTo); } return nAmount; } public double GetGradeDefinedAmount(Employee employee, EmployeeGradeSalary gradeSalary) { return this.GetGradeDefinedAmount(employee, gradeSalary.BasicSalary, gradeSalary.GrossSalary, gradeSalary.FractionofFromTo); } public double GetGradeDefinedAmount(Employee employee, double basicSalary, double grossSalary, double fractionate) { CarFuelParameterIndividual CarFuelIndividual = null; double nAmount = 0.0; switch (this.EntitleType) { case EnumEntitleType.Grade: if (this.PercentOfBasic > 0) //nAmount = basicSalary * this.PercentOfBasic / 100.0 + this.FlatAmount; if(this.IsFractionate) nAmount = nAmount + this.FlatAmount * fractionate + (basicSalary * this.PercentOfBasic * fractionate) / 100.0; else nAmount = nAmount + ((basicSalary * this.PercentOfBasic / 100.0) * fractionate); else if (this.PercentOfGross > 0) //nAmount = grossSalary * this.PercentOfGross / 100.0 + this.FlatAmount; if (this.IsFractionate) nAmount = nAmount + this.FlatAmount * fractionate + (basicSalary * this.PercentOfBasic * fractionate) / 100.0; else nAmount = nAmount + ((basicSalary * this.PercentOfBasic / 100.0) * fractionate); else nAmount = this.FlatAmount * fractionate; if (this.NotApplicable.Exists(delegate(CarFuelParameterIndividual adEmployee) { return adEmployee.EmployeeId.Integer == employee.ID.Integer; })) { nAmount = 0; } else { CarFuelParameterIndividual adEmp = this.Exception.Find(delegate(CarFuelParameterIndividual adEmployee) { return adEmployee.EmployeeId.Integer == employee.ID.Integer; }); if (adEmp != null) { switch (adEmp.ValueType) { case EnumValueType.Amount: nAmount = adEmp.Value; break; case EnumValueType.Other: if (this.PercentOfBasic > 0) nAmount = basicSalary * adEmp.Value / 100.0 * fractionate; //+ this.FlatAmount; // nAmount = basicSalary * adEmp.Value / 100.0 + this.FlatAmount; else if (this.PercentOfGross > 0) { nAmount = grossSalary * adEmp.Value / 100.0 * fractionate; //+ this.FlatAmount; //nAmount = grossSalary * adEmp.Value / 100.0 + this.FlatAmount; } break; } } } //if (this.IsFlatAmount == true) nAmount = GlobalFunctions.Round(nAmount * fractionate); //nAmount = GlobalFunctions.Round(nAmount * fractionate); break; case EnumEntitleType.Individual: throw new ServiceException("You have choosed the wrong overloaded function to calculate" + " Individual Allowance"); } if (this.MinAmount != 0 || this.MaxAmount != 0) { if (nAmount < this.MinAmount) { nAmount = this.MinAmount; } if (nAmount > this.MaxAmount) { nAmount = this.MaxAmount; } } return nAmount; } public double GetIndividualAmount(Employee employee, DateTime fortheMonth, CarFuelParameterIndividual ademployee) { return GetIndividualAmount(employee, fortheMonth, ademployee, employee.BasicSalary, employee.GrossSalary); } public double GetIndividualAmount(Employee employee, DateTime fortheMonth, CarFuelParameterIndividual ademployee, double basicSalary, double grossSalary) { double nAmount = 0.0; switch (this.EntitleType) { case EnumEntitleType.Grade: throw new ServiceException("You have choosed the wrong overloaded function to calculate" + " Grade defined Allowance"); case EnumEntitleType.Individual: if (ademployee.ArrearType == EnumArrearType.NotPresent) { DateTime fromDate = GlobalFunctions.FirstDateOfMonth(SystemInformation.CurrentSysInfo.NextPayProcessDate); DateTime toDate = SystemInformation.CurrentSysInfo.NextPayProcessDate; if (ademployee.FromDate < GlobalFunctions.FirstDateOfMonth(fortheMonth)) fromDate = GlobalFunctions.FirstDateOfMonth(fortheMonth); else fromDate=ademployee.FromDate; if (ademployee.ToDate == null || ademployee.ToDate == DateTime.MinValue) toDate = GlobalFunctions.LastDateOfMonth(fortheMonth); else toDate = (DateTime)ademployee.ToDate ; if (toDate > GlobalFunctions.LastDateOfMonth(fortheMonth)) toDate = GlobalFunctions.LastDateOfMonth(fortheMonth); if (ademployee.CarFuelPeriodicity != EnumCarFuelPeriodicity.OnceOff) if (employee.EndOfContractDate != null || employee.EndOfContractDate != DateTime.MinValue) if (employee.EndOfContractDate < toDate) toDate = (DateTime)employee.EndOfContractDate; if (ademployee.ValueType == EnumValueType.Other) { //while percent of basic then not required to do fractionate of date basis //if(this.PercentOfBasic >0) // nAmount = (basicSalary * ademployee.MonthlyAmount)/100 * GlobalFunctions.GetFraction(fromDate, toDate); //else if (this.PercentOfGross>0) // nAmount = (grossSalary * ademployee.MonthlyAmount)/100 * GlobalFunctions.GetFraction(fromDate, toDate); if (this.PercentOfBasic > 0) nAmount = (basicSalary * ademployee.Value) / 100 * GlobalFunctions.GetFraction(fromDate, toDate); else if (this.PercentOfGross > 0) nAmount = (grossSalary * ademployee.Value) / 100 * GlobalFunctions.GetFraction(fromDate, toDate); } else nAmount = ademployee.Value * GlobalFunctions.GetFraction(fromDate, toDate);//GlobalFunctions.GetFraction(fromDate, toDate); } else if (ademployee.ArrearType == EnumArrearType.ToCalculate) { if (ademployee.ValueType == EnumValueType.Other) { if (this.PercentOfBasic > 0) nAmount = (basicSalary * ademployee.Value) / 100 * GlobalFunctions.GetFraction(ademployee.FromDate , (DateTime)ademployee.ToDate ); else if (this.PercentOfGross > 0) nAmount = (grossSalary * ademployee.Value) / 100 * GlobalFunctions.GetFraction(ademployee.FromDate , (DateTime)ademployee.ToDate ); } else nAmount = ademployee.Value * GlobalFunctions.GetFraction(ademployee.FromDate , (DateTime)ademployee.ToDate); } break; } return nAmount; } public ObjectsTemplate ApplicableParameters(Employee emlpoyee, CarFuelProcessDetail oprocdetail, ObjectsTemplate allCarFuelParameters, ObjectsTemplate gradeSalaries) { ObjectsTemplate oparameters = new ObjectsTemplate(); foreach (EmployeeGradeSalary gs in gradeSalaries) { List lparameter = CarFuelParameter.GetApplicableParameters(emlpoyee, gs.GradeID, allCarFuelParameters); foreach (CarFuelParameter item in lparameter) { if (oparameters.Contains(item) == false) oparameters.Add(item); } } return oparameters; //foreach (EmployeeGradeSalary gs in oprocdetail.ArrearGradeSalaries) //{ // List alparameter = CarFuelParameter.GetApplicableParameters(emlpoyee, gs.GradeID, allCarFuelParameters); // gs.CarFuelParameters = new ObjectsTemplate(); // foreach (CarFuelParameter item in alparameter) // gs.CarFuelParameters.Add(item); //} //foreach (EmployeeGradeSalary gs in oprocdetail.ArrearPaidGradeSalaries) //{ // List aplparameter = CarFuelParameter.GetApplicableParameters(emlpoyee, gs.GradeID, allCarFuelParameters); // gs.CarFuelParameters = new ObjectsTemplate(); // foreach (CarFuelParameter item in aplparameter) // gs.CarFuelParameters.Add(item); //} } public static ObjectsTemplate GetGrades() { return CarFuelParameter.Service.GetGrades(Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } internal static ObjectsTemplate Get(EnumStatus enumStatus, EnumCarFuelType enumCarFuelType, EnumEntitleType enumEntitleType) { #region Cache Header ObjectsTemplate CarFuelitems = _cache["Get", enumStatus, enumCarFuelType, enumEntitleType] as ObjectsTemplate; if (CarFuelitems != null) return CarFuelitems; #endregion try { CarFuelitems = Service.Get(enumStatus, enumCarFuelType, enumEntitleType,Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(CarFuelitems, "Get", enumStatus, enumCarFuelType, enumEntitleType); #endregion return CarFuelitems; } internal static ObjectsTemplate Get(EnumStatus enumStatus,EnumEntitleType enumEntitleType) { #region Cache Header ObjectsTemplate CarFuelitems = _cache["Get", enumStatus, enumEntitleType] as ObjectsTemplate; if (CarFuelitems != null) return CarFuelitems; #endregion try { CarFuelitems = Service.Get(enumStatus, enumEntitleType,Payroll.BO.SystemInformation.CurrentSysInfo.PayrollTypeID.Integer); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(CarFuelitems, "Get", enumStatus, enumEntitleType); #endregion return CarFuelitems; } #endregion #region Service Factory internal static ICarFuelParameterService Service { get { return Services.Factory.CreateService(typeof(ICarFuelParameterService)); } } #endregion } #endregion #region ICarFuelParameter Service public interface ICarFuelParameterService { CarFuelParameter Get(ID id, int payrollTypeID); ObjectsTemplate Get(int payrollTypeID); ObjectsTemplate GetGrades(ID CarFuelParameterID, int payrollTypeID); ObjectsTemplate GetGrades(int payrollTypeID); ObjectsTemplate Get(EnumStatus status, int payrollTypeID); ObjectsTemplate Get(EnumStatus status, EnumCarFuelType type, int payrollTypeID); ObjectsTemplate Get(EnumStatus enumStatus, EnumCarFuelType enumCarFuelType, EnumEntitleType enumEntitleType, int payrollTypeID); ObjectsTemplate Get(EnumStatus enumStatus, EnumEntitleType enumEntitleType, int payrollTypeID); ID Save(CarFuelParameter oCarFuelParameter, int payrollTypeID); void Delete(ID id, int payrollTypeID); } #endregion }