Ejemplo n.º 1
0
 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));
     }
 }
Ejemplo n.º 2
0
 public EmailDataModel ViewLeaveFromEmail(Int64 leaveId, Int64 userId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.ViewLeaveFromEmail(leaveId, userId));
     }
 }
Ejemplo n.º 3
0
 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));
     }
 }
Ejemplo n.º 4
0
 public string ReturnWeekOff(long UserId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.ReturnWeekOff(UserId));
     }
 }
Ejemplo n.º 5
0
 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));
     }
 }
Ejemplo n.º 6
0
 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));
     }
 }
Ejemplo n.º 7
0
 public IList <HolidayModel> GetHolidays(long UserId, Int32 holidayYear)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetHolidays(UserId, holidayYear));
     }
 }
Ejemplo n.º 8
0
 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));
     }
 }
Ejemplo n.º 9
0
 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));
     }
 }
Ejemplo n.º 10
0
 public IList <LeaveSummary> GetLeaveSumary(long UserId, Int32 summaryYear)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetLeaveSumary(UserId, summaryYear));
     }
 }
Ejemplo n.º 11
0
 public string ChangeStatus(LeaveStatusModel status)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.ChangeStatus(status));
     }
 }
Ejemplo n.º 12
0
 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));
     }
 }
Ejemplo n.º 13
0
 public DashBoardModel GetDashboardData(Int64 UserId, Int64 OfficeId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetDashboardData(UserId, OfficeId));
     }
 }
Ejemplo n.º 14
0
 public string SaveLeaveRequest(LeaveRequestModel request)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.SaveLeaveRequest(request));
     }
 }
Ejemplo n.º 15
0
 public List <DropDownItem> GetYearsFromLeaveBalance()
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetYearsFromLeaveBalance());
     }
 }
Ejemplo n.º 16
0
 public IList <DropDownItem> GetWeekOffs(Int64 UserId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetWeekOffs(UserId));
     }
 }
Ejemplo n.º 17
0
 public List <LeaveTypesModel> GetLeaveTypes(long OfficeId, Int64 userId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetLeaveTypes(OfficeId, userId));
     }
 }
Ejemplo n.º 18
0
 public EmailDataModel GetEmailData(Int64 leaveId, string actionName)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetEmailData(leaveId, actionName));
     }
 }
Ejemplo n.º 19
0
 public int GetHolidayCount(DateTime startDate, DateTime endDate, long empId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetHolidayCount(startDate, endDate, empId));
     }
 }
Ejemplo n.º 20
0
 public IList <TeamLeaves> GetLeaveRequests(ManageTeamLeavesQueryModel qryMdl)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetLeaveRequests(qryMdl));
     }
 }
Ejemplo n.º 21
0
 public EmailDataModel GetEmailDataAddLeave(Int64 userID, Int64?leaveTypeID)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetEmailDataAddLeave(userID, leaveTypeID));
     }
 }
Ejemplo n.º 22
0
 public int GetPendingApprovalCount(Int64 userId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetPendingApprovalCount(userId));
     }
 }
Ejemplo n.º 23
0
 public IList <TeamLeaves> GetTeamLeaveHistory(ManageTeamLeavesQueryModel qryMdl)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetTeamLeaveHistory(qryMdl));
     }
 }
Ejemplo n.º 24
0
 public List <TimeSheetModel> GetMyTeamTimeSheet(Int64 UserID)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetMyTeamTimeSheet(UserID));
     }
 }
Ejemplo n.º 25
0
 public IList <EmployeeList> GetEmployeeList(string param, Int64 userId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.GetEmployeeList(param, userId));
     }
 }
Ejemplo n.º 26
0
 public IList <LeaveDetailModel> ShowLeaveDetail(Int64 LeaveId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.ShowLeaveDetail(LeaveId));
     }
 }
Ejemplo n.º 27
0
 public LeaveRequestModel ApplyLeaveCommonData(Int64 UserId, Int64 OfficeId)
 {
     using (var dac = new LeaveDac())
     {
         return(dac.ApplyLeaveCommonData(UserId, OfficeId));
     }
 }
Ejemplo n.º 28
0
        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);
        }
Ejemplo n.º 29
0
        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);
        }