186 lines
5.5 KiB
C#
186 lines
5.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Ease.Core;
|
|
using Ease.Core.Model;
|
|
using System.Data;
|
|
|
|
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region LeavePlan
|
|
|
|
public class LeavePlan : BasicBaseObject
|
|
{
|
|
|
|
#region Constructor
|
|
public LeavePlan()
|
|
{
|
|
//_empID = 0;
|
|
//_leaveID = ID.FromInteger(0);
|
|
//_leaveYear = 0;
|
|
//_planFromDate = DateTime.Now.Date;
|
|
//_planToDate = DateTime.Now.Date;
|
|
//_appTotalDays = 0;
|
|
//_entryDate = DateTime.Now.Date;
|
|
//_bIsApproved = false;
|
|
//_bIsSubmitted = false;
|
|
}
|
|
#endregion
|
|
|
|
#region Properties
|
|
public int EmpID { get; set; }
|
|
|
|
public int LeaveID { get; set; }
|
|
|
|
public int LeaveYear { get; set; }
|
|
|
|
public DateTime PlanFromDate { get; set; }
|
|
|
|
public DateTime PlanToDate { get; set; }
|
|
|
|
public double PlanTotalDays { get; set; }
|
|
|
|
public DateTime EntryDate { get; set; }
|
|
|
|
public bool IsApproved { get; set; }
|
|
|
|
public bool IsSubmitted { get; set; }
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
//#region Functions
|
|
|
|
//public static LeavePlan GetID(int id)
|
|
//{
|
|
// LeavePlan leavePlan = null;
|
|
// leavePlan = LeavePlan.Service.GetID(id);
|
|
// return leavePlan;
|
|
//}
|
|
|
|
//public static bool IsEmpIDExist(int empID, int leaveYear)
|
|
//{
|
|
// return LeavePlan.Service.IsEmpIDExist(empID, leaveYear);
|
|
//}
|
|
|
|
//public static bool IsEmpApproved(int empID, int leaveYear, DateTime FormDate, DateTime ToDate, bool isApprove)
|
|
//{
|
|
// return LeavePlan.Service.IsEmpApproved(empID, leaveYear, FormDate, ToDate, isApprove);
|
|
//}
|
|
|
|
//public static void Save(List<LeavePlan> leavePlans)
|
|
//{
|
|
// try
|
|
// {
|
|
// LeavePlan.Service.Save(leavePlans);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public static void UpDateLeavePlan(LeavePlan oLeaveItem, int PlanID)
|
|
//{
|
|
// try
|
|
// {
|
|
// LeavePlan.Service.UpDateLeavePlan(oLeaveItem, PlanID);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public static void UpdateApprove(int empID, int leaveYear, DateTime FormDate, DateTime ToDate, bool isApproved)
|
|
//{
|
|
// try
|
|
// {
|
|
// LeavePlan.Service.UpdateApprove(empID, leaveYear, FormDate, ToDate, isApproved);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public static void UpdateLeavePlanSubmit(List<LeavePlan> oLeaveItems)
|
|
//{
|
|
// try
|
|
// {
|
|
// LeavePlan.Service.UpdateLeavePlanSubmit(oLeaveItems);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public static void Delete(ID id)
|
|
//{
|
|
// LeavePlan.Service.Delete(id);
|
|
//}
|
|
//#endregion
|
|
|
|
//#region Collection Functions
|
|
|
|
//public static List<LeavePlan> Get(int empID)
|
|
//{
|
|
// List<LeavePlan> LeavePlans = null;
|
|
// LeavePlans = LeavePlan.Service.Get(empID);
|
|
// return LeavePlans;
|
|
//}
|
|
|
|
//public static List<LeavePlan> GetAllData()
|
|
//{
|
|
// List<LeavePlan> LeavePlans = null;
|
|
// LeavePlans = LeavePlan.Service.GetAllData();
|
|
// return LeavePlans;
|
|
//}
|
|
//public static List<LeavePlan> GetPlanData(int empID, int leaveYear)
|
|
//{
|
|
// List<LeavePlan> LeavePlans = null;
|
|
// LeavePlans = LeavePlan.Service.GetPlanData(empID, leaveYear);
|
|
// return LeavePlans;
|
|
//}
|
|
//public static List<LeavePlan> GetByMonthRange(int empID, DateTime dFromDate, DateTime dToDate)
|
|
//{
|
|
// List<LeavePlan> LeavePlans = null;
|
|
// LeavePlans = LeavePlan.Service.GetByMonthRange(empID, dFromDate, dToDate);
|
|
// return LeavePlans;
|
|
//}
|
|
//#endregion
|
|
|
|
//#region Service Factory
|
|
//internal static ILeavePlanService Service
|
|
//{
|
|
// get { return Services.Factory.CreateService<ILeavePlanService>(typeof(ILeavePlanService)); }
|
|
//}
|
|
//#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region ILeave Service
|
|
public interface ILeavePlanService
|
|
{
|
|
|
|
List<LeavePlan> Get(int empID);
|
|
List<LeavePlan> GetPlanData(int empID, int leaveYear);
|
|
List<LeavePlan> GetAllData();
|
|
LeavePlan GetID(int id);
|
|
List<LeavePlan> GetByMonthRange(int nEmpID, DateTime dFromDate, DateTime dToDate);
|
|
bool IsEmpIDExist(int empID, int leaveYear);
|
|
bool IsEmpApproved(int empID, int leaveYear, DateTime FormDate, DateTime ToDate, bool isApprove);
|
|
void Save(List<LeavePlan> leavePlans);
|
|
void Delete(int id);
|
|
void UpdateApprove(int empID, int leaveYear, DateTime FormDate, DateTime ToDate, bool isApproved);
|
|
void UpDateLeavePlan(LeavePlan oLeaveItem, int PlanID);
|
|
void UpdateLeavePlanSubmit(List<LeavePlan> oLPlans);
|
|
}
|
|
#endregion
|
|
}
|