public List<EmployeeLeaveEntity> GetEmployeeLeaveList(Guid userId) { string ExternalId = SynergyService.GetEmployeeExternalId(userId); EmployeeLeaveEntity leaveEntity=new EmployeeLeaveEntity(); leaveEntity.userId = ExternalId; List<EmployeeLeaveEntity> leaveList = new List<EmployeeLeaveEntity>(); leaveList=SynergyLeaveAdapter.GetEmployeeLeaveInfo(leaveEntity); return leaveList; }
public List<EmployeeLeaveEntity> GetleaveAllocationByUser(string User, DateTime startDate, DateTime endDate) { EmployeeLeaveEntity entity = new EmployeeLeaveEntity(); entity.endDate = endDate; entity.startDate = startDate; Guid id = Service.GetUserByName(User).UserId; entity.userId = Service.GetUserExternalId(id); return SynergyLeaveAdapter.GetEmployeeLeaveInfo(entity); }
static void Main(string[] args) { LeaveSystemEx.LeaveSystem system = new LeaveSystemEx.LeaveSystem(); EmployeeLeaveEntity entity=new EmployeeLeaveEntity(); entity.userId="832594342V"; List<EmployeeLeaveEntity> leavelist = new List<EmployeeLeaveEntity>(); leavelist = system.GetEmployeeLeave(entity.userId, DateTime.Now, DateTime.Now); Console.WriteLine(leavelist.Count); Console.Read(); }
/// <summary> /// Gets the employee leave info. /// </summary> /// <param name="leaveEntity">The leave entity.</param> /// <returns></returns> public static List<EmployeeLeaveEntity> GetEmployeeLeaveInfo(EmployeeLeaveEntity leaveEntity) { Assembly leaveAssembly = Assembly.LoadFile(AppDomain.CurrentDomain.BaseDirectory + "LeaveSystemEx.dll"); AssemblyName leaveAssemblyName = leaveAssembly.GetName(); Object leaveSystem = leaveAssembly.CreateInstance("LeaveSystemEx.LeaveSystem"); MethodInfo leaveMethod = leaveAssembly.GetType("LeaveSystemEx.LeaveSystem").GetMethod("GetEmployeeLeave"); List<EmployeeLeaveEntity> leaveList = (List<EmployeeLeaveEntity>)leaveMethod.Invoke(leaveSystem, new Object[] { leaveEntity.userId, leaveEntity.startDate, leaveEntity.endDate }); return leaveList; }
private List<EmployeeLeaveEntity> AssembleEntity(List< LM_EmployeeLeave> leaveList) { List<EmployeeLeaveEntity> leavelist = new List<EmployeeLeaveEntity>(); foreach (LM_EmployeeLeave leave in leaveList) { EmployeeLeaveEntity entity = new EmployeeLeaveEntity(); leave.LM_LeaveTypesReference.Load(); entity.leaveDate = (DateTime)leave.Date; entity.description = leave.LM_LeaveTypes.Description; leavelist.Add(entity); } return leavelist; }
private static EmployeeLeaveEntity AssembleEntity(EmployeeLeaves employee) { EmployeeLeaveEntity entity = new EmployeeLeaveEntity(); entity.startDate = (DateTime)employee.StartDate == null ? DateTime.Now : (DateTime)employee.StartDate; entity.endDate = (DateTime)employee.EndDate == null ? DateTime.Now : (DateTime)employee.EndDate; employee.LeaveTypesReference.Load(); entity.description = employee.LeaveTypes.Description; //entity. = employee.Email == null ? "" : employee.Email; //entity.ExternalId = employee.NIC == null ? "" : employee.NIC; //entity.FirstName = employee.FirstName == null ? "" : employee.FirstName; //entity.LastName = employee.LastName == null ? "" : employee.LastName; //entity.Phone = employee.Phone == null ? "" : employee.Phone; return entity; }
private static List<EmployeeLeaveEntity> AssembleEntityList( List<LM_EmployeeLeave> employeeleavelist) { List<EmployeeLeaveEntity> employeeLsit = new List<EmployeeLeaveEntity>(); foreach (LM_EmployeeLeave empleave in employeeleavelist) { EmployeeLeaveEntity entity = new EmployeeLeaveEntity(); entity.leaveDate =(DateTime) empleave.Date; employeeLsit.Add(entity); } //entity. = employee.Email == null ? "" : employee.Email; //entity.ExternalId = employee.NIC == null ? "" : employee.NIC; //entity.FirstName = employee.FirstName == null ? "" : employee.FirstName; //entity.LastName = employee.LastName == null ? "" : employee.LastName; //entity.Phone = employee.Phone == null ? "" : employee.Phone; return employeeLsit; }