public decimal ReturnDuration(DateTime LeaveFrom, DateTime LeaveUpto, string LeaveFromTime, string LeaveUptoTime, Int64 UserId) { using (var dac = new LeaveDac()) { return(dac.ReturnDuration(LeaveFrom, LeaveUpto, LeaveFromTime, LeaveUptoTime, UserId)); } }
public EmailDataModel ViewLeaveFromEmail(Int64 leaveId, Int64 userId) { using (var dac = new LeaveDac()) { return(dac.ViewLeaveFromEmail(leaveId, userId)); } }
public IList <LeaveDtl> GetLeaveDetailCalculation(DateTime LeaveFrom, DateTime LeaveUpto, string LeaveFromTime, string LeaveUptoTime, Int64 UserId, Int64 LeaveTypText) { using (var dac = new LeaveDac()) { return(dac.GetLeaveDetailCalculation(LeaveFrom, LeaveUpto, LeaveFromTime, LeaveUptoTime, UserId, LeaveTypText)); } }
public string ReturnWeekOff(long UserId) { using (var dac = new LeaveDac()) { return(dac.ReturnWeekOff(UserId)); } }
public IList <DaywiseLeaveDtlModel> GetDaywiseLeaveDtl(DateTime?FromDate, DateTime?ToDate, bool IsLeaveOnly, Int64 LeadId, bool OnlyReportedToMe, Int64?paramUserId, string reqUsr, bool DonotShowRejected) { using (var dac = new LeaveDac()) { return(dac.GetDaywiseLeaveDtl(FromDate, ToDate, IsLeaveOnly, LeadId, OnlyReportedToMe, paramUserId, reqUsr, DonotShowRejected)); } }
public IList <MonthwiseLeavesCountModel> GetMonthwiseLeavesCount(Int32 year, Int64 LeadId, bool OnlyReportedToMe, Int64?paramUserId, string reqUsr) { using (var dac = new LeaveDac()) { return(dac.GetMonthwiseLeavesCount(year, LeadId, OnlyReportedToMe, paramUserId, reqUsr)); } }
public IList <HolidayModel> GetHolidays(long UserId, Int32 holidayYear) { using (var dac = new LeaveDac()) { return(dac.GetHolidays(UserId, holidayYear)); } }
public IList <EmployeeWiseLeaveSummaryModel> GetEmployeeWiseLeaveSumary(Int64 UserId, int Year, string reqUsr, Int64?paramUserId, bool OnlyReportedToMe) { using (var dac = new LeaveDac()) { return(dac.GetEmployeeWiseLeaveSumary(UserId, Year, reqUsr, paramUserId, OnlyReportedToMe)); } }
public IList <HolidayModel> GetHolidaysDetails(long UserId, int holidayYear, ref bool previousYear, ref bool nextYear) { using (var dac = new LeaveDac()) { return(dac.GetHolidaysDetails(UserId, holidayYear, ref previousYear, ref nextYear)); } }
public IList <LeaveSummary> GetLeaveSumary(long UserId, Int32 summaryYear) { using (var dac = new LeaveDac()) { return(dac.GetLeaveSumary(UserId, summaryYear)); } }
public string ChangeStatus(LeaveStatusModel status) { using (var dac = new LeaveDac()) { return(dac.ChangeStatus(status)); } }
public IList <PermissionDetailsModel> GetOverTimePermissionDetail(Int64?paramUserId, string reqUsr, DateTime?startDate, DateTime?endDate, bool OnlyReportedToMe, Int64 LeadId) { using (var dac = new LeaveDac()) { return(dac.GetOverTimePermissionDetail(paramUserId, reqUsr, startDate, endDate, OnlyReportedToMe, LeadId)); } }
public DashBoardModel GetDashboardData(Int64 UserId, Int64 OfficeId) { using (var dac = new LeaveDac()) { return(dac.GetDashboardData(UserId, OfficeId)); } }
public string SaveLeaveRequest(LeaveRequestModel request) { using (var dac = new LeaveDac()) { return(dac.SaveLeaveRequest(request)); } }
public List <DropDownItem> GetYearsFromLeaveBalance() { using (var dac = new LeaveDac()) { return(dac.GetYearsFromLeaveBalance()); } }
public IList <DropDownItem> GetWeekOffs(Int64 UserId) { using (var dac = new LeaveDac()) { return(dac.GetWeekOffs(UserId)); } }
public List <LeaveTypesModel> GetLeaveTypes(long OfficeId, Int64 userId) { using (var dac = new LeaveDac()) { return(dac.GetLeaveTypes(OfficeId, userId)); } }
public EmailDataModel GetEmailData(Int64 leaveId, string actionName) { using (var dac = new LeaveDac()) { return(dac.GetEmailData(leaveId, actionName)); } }
public int GetHolidayCount(DateTime startDate, DateTime endDate, long empId) { using (var dac = new LeaveDac()) { return(dac.GetHolidayCount(startDate, endDate, empId)); } }
public IList <TeamLeaves> GetLeaveRequests(ManageTeamLeavesQueryModel qryMdl) { using (var dac = new LeaveDac()) { return(dac.GetLeaveRequests(qryMdl)); } }
public EmailDataModel GetEmailDataAddLeave(Int64 userID, Int64?leaveTypeID) { using (var dac = new LeaveDac()) { return(dac.GetEmailDataAddLeave(userID, leaveTypeID)); } }
public int GetPendingApprovalCount(Int64 userId) { using (var dac = new LeaveDac()) { return(dac.GetPendingApprovalCount(userId)); } }
public IList <TeamLeaves> GetTeamLeaveHistory(ManageTeamLeavesQueryModel qryMdl) { using (var dac = new LeaveDac()) { return(dac.GetTeamLeaveHistory(qryMdl)); } }
public List <TimeSheetModel> GetMyTeamTimeSheet(Int64 UserID) { using (var dac = new LeaveDac()) { return(dac.GetMyTeamTimeSheet(UserID)); } }
public IList <EmployeeList> GetEmployeeList(string param, Int64 userId) { using (var dac = new LeaveDac()) { return(dac.GetEmployeeList(param, userId)); } }
public IList <LeaveDetailModel> ShowLeaveDetail(Int64 LeaveId) { using (var dac = new LeaveDac()) { return(dac.ShowLeaveDetail(LeaveId)); } }
public LeaveRequestModel ApplyLeaveCommonData(Int64 UserId, Int64 OfficeId) { using (var dac = new LeaveDac()) { return(dac.ApplyLeaveCommonData(UserId, OfficeId)); } }
public List <EmployeeLeave> GetLeaveForEmployee(Int64 UserID, DateTime FromDate, DateTime ToDate) { List <EmployeeLeave> leaveList = new List <EmployeeLeave>(); LeaveDac lv = new LeaveDac(); try { using (var context = new NLTDDbContext()) { leaveList = (from l in context.Leave join lt in context.LeaveType on l.LeaveTypeId equals lt.LeaveTypeId join ld in context.LeaveDetail on l.LeaveId equals ld.LeaveId where l.UserId == UserID && l.Status == "A" && ld.IsDayOff == false && ld.LeaveDate >= FromDate && ld.LeaveDate <= ToDate select new EmployeeLeave { UserId = l.UserId, StartDate = ld.LeaveDate, EndDate = ld.LeaveDate, LeaveType = lt.Type, LeaveDayQty = ld.LeaveDayQty, StartDateType = ld.PartOfDay, EndDateType = ld.PartOfDay, LeaveTypeId = l.LeaveTypeId, IsLeave = lt.IsLeave, WorkFromHomeDayQty = ld.LeaveDayQty } ).ToList(); List <EmployeeLeave> PermissionList = (from l in context.Leave join lt in context.LeaveType on l.LeaveTypeId equals lt.LeaveTypeId join ld in context.PermissionDetail on l.LeaveId equals ld.LeaveId where l.UserId == UserID && l.Status == "A" && ld.PermissionDate >= FromDate && ld.PermissionDate <= ToDate select new EmployeeLeave { UserId = l.UserId, StartDate = ld.PermissionDate, EndDate = ld.PermissionDate, LeaveType = lt.Type, TimeFrom = ld.TimeFrom, TimeTo = ld.TimeTo, LeaveTypeId = l.LeaveTypeId, IsLeave = lt.IsLeave } ).ToList(); PermissionList.ForEach(pl => pl.PermissionCount = Math.Round((decimal)(lv.CalculateDuration(pl.TimeFrom, pl.TimeTo).TotalMinutes) / 60, 2)); if (PermissionList.Count > 0) { leaveList.AddRange(PermissionList); } } } catch (Exception) { throw; } return(leaveList); }
public IList <LeaveTransactionDetail> GetTransactionLog(string Name, string RequestMenuUser, long leadUserId) { IList <LeaveTransactionDetail> retModel = new List <LeaveTransactionDetail>(); LeaveDac lv = new LeaveDac(); IList <Int64> empList = lv.GetEmployeesReporting(leadUserId); try { using (var context = new NLTDDbContext()) { EmployeeDac employeeDac = new EmployeeDac(); long userId = 0; if (RequestMenuUser != "My") { userId = employeeDac.GetUserId(Name); } if (userId > 0 || (RequestMenuUser == "My" && leadUserId > 0)) { string ReportingTo = (RequestMenuUser == "My" && leadUserId > 0) ? employeeDac.ReportingToName(leadUserId) : employeeDac.ReportingToName(userId); List <LeaveTransactionHistoryModel> transactionDetails = new List <LeaveTransactionHistoryModel>(); if (RequestMenuUser == "My") { transactionDetails = GetTransactionDetails(context, leadUserId); } if (RequestMenuUser == "Team") { string leadRole = employeeDac.GetEmployeeRole(leadUserId); if (leadRole == "ADMIN" || leadRole == "HR") { transactionDetails = GetTransactionDetails(context, userId); } else { var user = empList.Where(x => x == userId).FirstOrDefault(); if (user > 0) { transactionDetails = GetTransactionDetails(context, userId); } } } var groupedLeaveList = transactionDetails.GroupBy(u => u.LeaveTypeId) .Select(grp => new { LeaveTypeId = grp.Key, leaveTransactionHistoryModel = grp.ToList() }) .ToList(); retModel = (from gv in groupedLeaveList select new LeaveTransactionDetail { ReportingTo = ReportingTo, LeaveTypeId = gv.LeaveTypeId, LeaveType = gv.leaveTransactionHistoryModel[0].Type, leaveTransactionHistoryModel = gv.leaveTransactionHistoryModel }).ToList(); } } } catch (Exception) { throw; } return(retModel); }