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 { [Serializable] public class ProdBonusProcess : BasicBaseObject { #region Constructor public ProdBonusProcess() { } #endregion #region Properties #region SalaryMonth : DateTime private DateTime _SalaryMonth; public DateTime SalaryMonth { get { return _SalaryMonth; } set { _SalaryMonth = value; } } #endregion #region ProcessDate : DateTime private DateTime _ProcessDate; public DateTime ProcessDate { get { return _ProcessDate; } set { _ProcessDate = value; } } #endregion #region Property ProdBonusProcessEmps : ProdBonusProcessEmp private ObjectsTemplate _ProdBonusProcessEmps; public ObjectsTemplate ProdBonusProcessEmps { get { if (_ProdBonusProcessEmps == null && !this.ID.IsUnassigned && this.ID.Integer > 0) { _ProdBonusProcessEmps = Service.GetProdBonusProcessEmps(this.ID); } return _ProdBonusProcessEmps; } set { _ProdBonusProcessEmps = value; } } #endregion #region Property ProdBonusProcessItems : ProdBonusProcessItem private ObjectsTemplate _ProdBonusProcessItems; public ObjectsTemplate ProdBonusProcessItems { get { if (_ProdBonusProcessItems == null && !this.ID.IsUnassigned && this.ID.Integer > 0) { _ProdBonusProcessItems = Service.GetProdBonusProcessItems(this.ID); } return _ProdBonusProcessItems; } set { _ProdBonusProcessItems = value; } } #endregion #endregion #region Functions #region Get All public static ObjectsTemplate Get() { return ProdBonusProcess.Service.Get(); } public static ProdBonusProcessEmp GetProdBonusEmp(ID Id, DateTime salaryMonth) { return ProdBonusProcess.Service.GetProdBonusEmp(Id,salaryMonth); } #endregion #region Get By ID public static ProdBonusProcess Get(ID id) { return ProdBonusProcess.Service.Get(id); } #endregion #region Get By Status public static ObjectsTemplate Get(DateTime dtSalaryMonth) { return ProdBonusProcess.Service.Get(dtSalaryMonth); } public static DataSet GetDetailItems(DateTime dtSalaryMonth) { return ProdBonusProcess.Service.GetDetailItems(dtSalaryMonth); } #endregion #region Get DataSet For Report public static DataSet GetMontlyProdBonus(DateTime dBonusMonth) { DataSet ds = null; try { ds = Service.GetMontlyProdBonus(dBonusMonth); } catch (Exception e) { throw new Exception(e.Message, e); } return ds; } public static DataSet GetProdBonusDetail(int designID) { DataSet ds = null; try { ds = Service.GetProdBonusDetail(designID); } catch (Exception e) { throw new Exception(e.Message, e); } return ds; } public static DataSet EmpDesignWiseProdBonus(DateTime dBonusMonth) { DataSet ds = null; try { ds = Service.EmpDesignWiseProdBonus(dBonusMonth); } catch (Exception e) { throw new Exception(e.Message, e); } return ds; } #endregion #region Save public static void Save(ObjectsTemplate items) { foreach(ProdBonusProcess item in items) item.SetAuditTrailProperties(); ProdBonusProcess.Service.Save(items); } #endregion #region Delete public static void Delete(ID id) { ProdBonusProcess.Service.Delete(id); } #endregion #region Undo public static void UndoProcess(ObjectsTemplate oProdBonusProsses, ADParameter _ADParam, DateTime dtSalaryMonth) { ProdBonusProcess.Service.UndoProcess(oProdBonusProsses, _ADParam,dtSalaryMonth); } #endregion #endregion #region Service Factory IProdBonusProcess : IProdBonusProcess internal static IProdBonusProcessService Service { get { return Services.Factory.CreateService(typeof(IProdBonusProcessService)); } } #endregion } [Serializable] public class ProdBonusProcessEmp : BasicBaseObject { #region Constructor public ProdBonusProcessEmp() { _description = string.Empty; } #endregion #region Properties #region ProdBonusProcessID : ID private ID _ProdBonusProcessID; public ID ProdBonusProcessID { get { return _ProdBonusProcessID; } set { _ProdBonusProcessID = value; } } #endregion #region EmployeeID : ID private ID _EmployeeID; public ID EmployeeID { get { return _EmployeeID; } set { _EmployeeID = value; } } #endregion #region Amount : Double private double _Amount; public double Amount { get { return _Amount; } set { _Amount = value; } } #endregion #region Description : string private string _description; public string Description { get { return _description; } set { _description = value; } } #endregion #endregion } [Serializable] public class ProdBonusProcessItem : BasicBaseObject { #region Constructor public ProdBonusProcessItem() { } #endregion #region Properties #region ProdBonusProcessID : ID private ID _ProdBonusProcessID; public ID ProdBonusProcessID { get { return _ProdBonusProcessID; } set { _ProdBonusProcessID = value; } } #endregion #region ProdBonusSetupID : ID private ID _ProdBonusSetupID; public ID ProdBonusSetupID { get { return _ProdBonusSetupID; } set { _ProdBonusSetupID = value; } } #endregion #region ProdBonusLineID : ID private ID _prodBonusLineID; public ID ProdBonusLineID { get { return _prodBonusLineID; } set { _prodBonusLineID = value; } } #endregion #region EmployeeID : ID private ID _EmployeeID; public ID EmployeeID { get { return _EmployeeID; } set { _EmployeeID = value; } } #endregion #region Amount : double private double _Amount; public double Amount { get { return _Amount; } set { _Amount = value; } } #endregion #region OTHour : double private double _oTHour; public double OTHour { get { return _oTHour; } set { _oTHour = value; } } #endregion #region AchievePercent : double private double _achievePercent; public double AchievePercent { get { return _achievePercent; } set { _achievePercent = value; } } #endregion #region WorkingHour : double private double _workingHour; public double WorkingHour { get { return _workingHour; } set { _workingHour = value; } } #endregion #region WorkingHour : double private string _description; public string Description { get { return _description; } set { _description = value; } } #endregion #endregion } #region IProdBonusProcess Service public interface IProdBonusProcessService { ObjectsTemplate Get(); ObjectsTemplate Get(DateTime dtSalaryMonth); DataSet GetDetailItems(DateTime dtSalaryMonth); ProdBonusProcess Get(ID id); void Save(ObjectsTemplate items); void Delete(ID id); ObjectsTemplate GetProdBonusProcessEmps(ID nProcessID); ObjectsTemplate GetProdBonusProcessItems(ID nProcessID); DataSet GetMontlyProdBonus(DateTime dBonusMonth); DataSet GetProdBonusDetail(int designID); DataSet EmpDesignWiseProdBonus(DateTime dBonusMonth); void UndoProcess(ObjectsTemplate oProdBonusProsses, ADParameter _ADParam, DateTime dtSalaryMonth); ProdBonusProcessEmp GetProdBonusEmp(ID Id, DateTime salaryMonth); } #endregion }