EchoTex_Payroll/HRM.BO/Attendance/WorkPlanGroup.cs

307 lines
8.4 KiB
C#
Raw Normal View History

2024-10-14 10:01:49 +06:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ease.Core;
using System.Data;
namespace HRM.BO
{
#region WorkPlanGroup
[Serializable]
public class WorkPlanGroup : BasicBaseObject
{
#region Constructor
public WorkPlanGroup()
{
_status = EnumStatus.Active;
}
#endregion
#region Properties
//#region WeekEndOn : Enum DayOfWeek
//private DayOfWeek? _weekEndOn;
//public DayOfWeek? WeekEndOn
//{
// get { return _weekEndOn; }
// set { _weekEndOn = value; }
//}
//#endregion
//#region WeekEndOn2 : Enum DayOfWeek
//private DayOfWeek? _weekEndOn2;
//public DayOfWeek? WeekEndOn2
//{
// get { return _weekEndOn2; }
// set { _weekEndOn2 = value; }
//}
//#endregion
public string Name { get; set; }
public EnumWorkPlanGroup Type { get; set; }
public string TypeName { get; set; }
public int InitialShiftID { get; set; }
public int? SaturdayShiftID { get; set; }
public int? SundayShiftID { get; set; }
public int? MondayShiftID { get; set; }
public int? TuesdayShiftID { get; set; }
public int? WednesdayShiftID { get; set; }
public int? ThursdayShiftID { get; set; }
public int? FridayShiftID { get; set; }
public HolidayDayOfWeek HolidayOne { get; set; }
public HolidayDayOfWeek HolidayTwo { get; set; }
public int PayrollTypeID { get; set; }
#region WorkPlanGroupType : EnumWorkPlanGroupType
private EnumWorkPlanGroup _workPlanGroupType;
public EnumWorkPlanGroup WorkPlanGroupType
{
get { return _workPlanGroupType; }
set
{
//base.OnPropertyChange<short>("WorkPlanGroupType", (short)_workPlanGroupType, (short)value);
_workPlanGroupType = value;
}
}
#endregion
public bool HasTwoHolidays
{
get { return HolidayOne != HolidayDayOfWeek.None && HolidayTwo != HolidayDayOfWeek.None; }
}
//#region Service Factory IWorkPlanGroupService : IWorkPlanGroupService
//internal static IWorkPlanGroupService Service
//{
// get { return Services.Factory.CreateService<IWorkPlanGroupService>(typeof(IWorkPlanGroupService)); }
//}
//#endregion
#endregion
//#region Functions
//public static WorkPlanGroup Get(ID nID)
//{
// WorkPlanGroup oWorkPlanGroup = null;
// #region Cache Header
// oWorkPlanGroup = (WorkPlanGroup)_cache["Get", nID];
// if (oWorkPlanGroup != null)
// return oWorkPlanGroup;
// #endregion
// oWorkPlanGroup = WorkPlanGroup.Service.Get(nID);
// #region Cache Footer
// _cache.Add(oWorkPlanGroup, "Get", nID);
// #endregion
// return oWorkPlanGroup;
//}
//public static ObjectsTemplate<WorkPlanGroup> GetByPayrollType(int id)
//{
// #region Cache Header
// ObjectsTemplate<WorkPlanGroup> workPlanGroups = _cache["GetByPayrollType"] as ObjectsTemplate<WorkPlanGroup>;
// if (workPlanGroups != null)
// return workPlanGroups;
// #endregion
// try
// {
// workPlanGroups = Service.Get(id);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(workPlanGroups, "GetByPayrollType");
// #endregion
// return workPlanGroups;
//}
//public static ObjectsTemplate<WorkPlanGroup> Get()
//{
// #region Cache Header
// ObjectsTemplate<WorkPlanGroup> workPlanGroups = _cache["Get"] as ObjectsTemplate<WorkPlanGroup>;
// if (workPlanGroups != null)
// return workPlanGroups;
// #endregion
// try
// {
// workPlanGroups = Service.Get();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(workPlanGroups, "Get");
// #endregion
// return workPlanGroups;
//}
//public static ObjectsTemplate<WorkPlanGroup> Get(EnumStatus status)
//{
// #region Cache Header
// ObjectsTemplate<WorkPlanGroup> workPlanGroups = _cache["Get", status] as ObjectsTemplate<WorkPlanGroup>;
// if (workPlanGroups != null)
// return workPlanGroups;
// #endregion
// try
// {
// workPlanGroups = Service.Get(status);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(workPlanGroups, "Get", status);
// #endregion
// return workPlanGroups;
//}
//public static ObjectsTemplate<WorkPlanGroup> Get(EnumWorkPlanGroup WPG)
//{
// #region Cache Header
// ObjectsTemplate<WorkPlanGroup> workPlanGroups = _cache["Get", WPG] as ObjectsTemplate<WorkPlanGroup>;
// if (workPlanGroups != null)
// return workPlanGroups;
// #endregion
// try
// {
// workPlanGroups = Service.Get(WPG);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(workPlanGroups, "Get", WPG);
// #endregion
// return workPlanGroups;
//}
//public ID Save()
//{
// this.SetAuditTrailProperties();
// return WorkPlanGroup.Service.Save(this);
//}
//public void Delete(ID id)
//{
// WorkPlanGroup.Service.Delete(id);
//}
//public void Delete()
//{
// WorkPlanGroup.Service.Delete(ID);
//}
//public static ObjectsTemplate<WorkPlanGroup> GetByName(string name)
//{
// #region Cache Header
// ObjectsTemplate<WorkPlanGroup> workPlanGroups = _cache["Get", name] as ObjectsTemplate<WorkPlanGroup>;
// if (workPlanGroups != null)
// return workPlanGroups;
// #endregion
// try
// {
// workPlanGroups = Service.GetByName(name, SystemInformation.CurrentSysInfo.PayrollTypeID.Integer);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(workPlanGroups, "Get", name);
// #endregion
// return workPlanGroups;
//}
//public static ObjectsTemplate<WorkPlanGroup> GetAll()
//{
// #region Cache Header
// ObjectsTemplate<WorkPlanGroup> workPlanGroups = _cache["Get"] as ObjectsTemplate<WorkPlanGroup>;
// if (workPlanGroups != null)
// return workPlanGroups;
// #endregion
// try
// {
// workPlanGroups = Service.GetAll();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(workPlanGroups, "Get");
// #endregion
// return workPlanGroups;
//}
//#endregion
}
#endregion
#region IWorkPlanGroup Service
public interface IWorkPlanGroupService
{
WorkPlanGroup Get(int id);
List<WorkPlanGroup> Get(EnumStatus status, int payrollTypeID, string name, EnumWorkPlanGroup? wPlanGroup);
int Save(WorkPlanGroup item, int payrollTypeID);
void Delete(int id);
WorkPlanGroup Get(Employee oEmployee);
WorkPlanGroup GetByEmpId(int oEmployeeId);
List<WorkPlanGroup> GetAll();
List<WorkPlanGroup> GetByPayrollTypeId(int payrollTypeId);
}
#endregion
}