/// <summary> /// Method Name : GetDetails /// Author : Yaseen Agwan /// Creation Date : 17 October 2019 /// Purpose : To get the list of employees. /// </summary> /// <param name="employeeId"> EmployeeId</param> /// <returns> Return Resignation </returns> public List <EmployeeResignationViewModel> GetDetails(int employeeId) { var resignationDetails = (from details in _resignationContext.Resignations join employee in _resignationContext.Employees on details.EmployeeId equals employee.EmployeeId where details.EmployeeId == employeeId select new EmployeeResignationViewModel { ResignationId = details.ResignationId, EmployeeId = details.EmployeeId, HRId = details.HRId, RMId = details.ManagerId, ResignationProposedDate = details.ResignationProposedDate, ResignationApprovedDate = details.ResignationApprovedDate, NoticePeroid = employee.NoticePeriod, RaisedOnDate = details.CreatedDate, ResignationReason = details.ResignationReason, Status = details.ResignationStatus, RevokeReason = details.RevokeRemark, ManageRemarks = details.ManagerRemark, HRRemarks = details.HRRemark, }).ToList(); foreach (var items in resignationDetails) { items.ConcernEmployees = _concernEmployees.GetAllTheConcernEmployees(items.ResignationId); } return(resignationDetails.ToList()); }
/// <summary> /// Method Name : GetEmployeeDetails /// Author : Divya Patel /// Creation Date : 16 October 2019 /// Purpose : Invokes the get API request for EmployeeDetails View for Approve and Reject /// </summary> /// <param name="resignationId">resignationId</param> /// <param name="subId">subId</param> /// <returns></returns> public EmployeeDetailViewModel GetResignationDetails(int resignationId, string subId) { var resignationDetails = (from employee in _context.Employees join domain in _context.Domains on employee.DomainId equals domain.DomainId join technology in _context.Technologies on employee.TechnologyID equals technology.TechnologyId join designation in _context.Designations on employee.DesignationId equals designation.DesignationId join resignations in _context.Resignations on employee.EmployeeId equals resignations.EmployeeId where resignations.ResignationId == resignationId select new EmployeeDetailViewModel { FirstName = employee.FirstName, LastName = employee.LastName, EmployeeCode = employee.EmployeeCode, EmployeeReason = resignations.ResignationReason, EmployeeId = employee.EmployeeId, Domain = domain.DomainName, Technology = technology.TechnologyName, Designation = designation.DesignationName, RaisedOnDate = resignations.RaisedOnDate.Value, ProposedRelievingDate = resignations.ResignationProposedDate.Value, ReportingManagerId = employee.ManagerId, ReportingPersonRemark = resignations.ManagerRemark, HrRemark = resignations.HRRemark, ApprovedNoticePeriod = employee.NoticePeriod, ExitInterviewDate = resignations.ExitInterviewDate.Value, IsRehiredByHR = resignations.IsRehiredByHR, IsRehiredByRM = resignations.IsRehiredByManager, ApprovedRelievingDate = resignations.ResignationApprovedDate.Value, ResignationId = resignations.ResignationId, ManagerName = GetEmployeeName(subId), OnBoardingNoticePeriod = employee.NoticePeriod, ResignationProposedDate = resignations.ResignationProposedDate, ResignationApprovedDate = resignations.ResignationApprovedDate, Status = resignations.ResignationStatus, }).FirstOrDefault(); resignationDetails.ConcernEmployees = _concernEmployees.GetAllTheConcernEmployees(resignationDetails.ResignationId); return(resignationDetails); }