示例#1
0
        public static List <EmployeeUsersDetails> GetEmployeesExceptAdmin(int page)
        {
            int takeCount = Config.PageItemCount();
            int skipCount = page * takeCount;

            return(EmployeesRepositories.GetEmployeesExceptAdmin(skipCount, takeCount));
        }
示例#2
0
        public static EditProfileModel GetEditProfileModel(int userId)
        {
            EditProfileModel     model    = new EditProfileModel();
            EmployeeUsersDetails employee = EmployeesRepositories.GetEmployeeUserDetailsById(userId);

            model.UserId                  = employee.UserId;
            model.EmployeeId              = employee.EmployeeId;
            model.FirstName               = employee.FirstName;
            model.LastName                = employee.LastName;
            model.Email                   = employee.Email;
            model.Address                 = employee.Address;
            model.Phone1                  = employee.Phone1;
            model.Phone2                  = employee.Phone2;
            model.RoleId                  = employee.RoleId;
            model.RoleName                = employee.RoleDisplayName;
            model.CurrentSalary           = employee.CurrentSalary;
            model.PreviousSalary          = employee.PreviousSalary;
            model.LastIncrementPercentage = employee.LastIncrementPercentage;
            model.JoinDate                = employee.JoinDate;
            model.ImgURL                  = employee.ImgURL;
            model.BirthDate               = employee.BirthDate;
            model.day   = employee.BirthDate.Day;
            model.Month = employee.BirthDate.Month;
            model.year  = employee.BirthDate.Year;
            model.Image = employee.Image;

            model.NumberOfDaysInMonth = DateTime.DaysInMonth(model.year, model.Month);

            return(model);
        }
示例#3
0
        public static EditProfileModel GetEditProfileModel(string userName)
        {
            EmployeeUsersDetails employee = EmployeesRepositories.GetEmployeeByUserName(userName);
            EditProfileModel     model    = new EditProfileModel
            {
                UserId              = employee.UserId,
                EmployeeId          = employee.EmployeeId,
                FirstName           = employee.FirstName,
                LastName            = employee.LastName,
                Email               = employee.Email,
                Address             = employee.Address,
                Phone1              = employee.Phone1,
                Phone2              = employee.Phone2,
                CurrentSalary       = employee.CurrentSalary,
                PreviousSalary      = employee.PreviousSalary,
                JoinDate            = employee.JoinDate,
                ImgURL              = employee.ImgURL,
                BirthDate           = employee.BirthDate,
                day                 = employee.day,
                Month               = employee.Month,
                year                = employee.year,
                NumberOfDaysInMonth = employee.NumberOfDaysInMonth,
            };

            return(model);
        }
示例#4
0
        public static void UpdateEmployee(EditProfileModel employee)
        {
            DateTime             todayDate = DateTimeHelper.Today();
            EmployeeUsersDetails model     = new EmployeeUsersDetails
            {
                UserId              = employee.UserId,
                EmployeeId          = employee.EmployeeId,
                FirstName           = employee.FirstName,
                LastName            = employee.LastName,
                Email               = employee.Email,
                Address             = employee.Address,
                Phone1              = employee.Phone1,
                Phone2              = employee.Phone2,
                CurrentSalary       = employee.CurrentSalary,
                PreviousSalary      = employee.PreviousSalary,
                JoinDate            = employee.JoinDate,
                ImgURL              = employee.ImgURL,
                BirthDate           = employee.BirthDate,
                day                 = employee.day,
                Month               = employee.Month,
                year                = employee.year,
                NumberOfDaysInMonth = employee.NumberOfDaysInMonth,
            };

            EmployeesRepositories.UpdateEmployee(model, todayDate);
        }
示例#5
0
        public static List <EmployeeUsersDetails> GetEmployeesByRoleId(int roleId, int page)
        {
            int takeCount = Config.PageItemCount();
            int skipCount = page * takeCount;

            return(EmployeesRepositories.GetEmployeesByRoleId(roleId, skipCount, takeCount));
        }
示例#6
0
        public static OnlineUserModel GetOnlineUsers()
        {
            DateTime        todayDate = DateTimeHelper.Today();
            OnlineUserModel model     = new OnlineUserModel();

            model.OnlineUsers = EmployeesRepositories.GetUsersSignIn(todayDate);
            model.NotComeUser = EmployeesRepositories.GetNotComeUser(todayDate);
            model.LeaveUser   = EmployeesRepositories.GetUserLeaved(todayDate);
            model.Date        = DateTimeHelper.Today();
            return(model);
        }
示例#7
0
        public static List <UserHistoryDetails> GetUsersHistory(int page)
        {
            int takeCount       = Config.PageItemCount();
            int skipCount       = page * takeCount;
            var userHistoryList = EmployeesRepositories.GetUsersHistory(skipCount, takeCount);

            foreach (var userHistory in userHistoryList)
            {
                int days, years, months, weeks;
                DateTimeHelper.GetDifference(userHistory.JoinDate, DateTimeHelper.Today(), out years, out months, out weeks, out days);
                userHistory.Years  = years;
                userHistory.Months = months;
                userHistory.Weeks  = weeks;
                userHistory.Days   = days;
            }
            return(userHistoryList);
        }
示例#8
0
        public static void InsertNewEmployee(EmployeeUsersDetails employeeUser)
        {
            int      userId   = UserProfilesRepository.GetUserByUserName(employeeUser.UserName).UserId;
            Employee employee = new Employee();

            employee.CurrentSalary = employeeUser.CurrentSalary;
            employee.JoinDate      = employeeUser.JoinDate;
            employee.UserId        = userId;
            employee.CreateDate    = DateTimeHelper.Today();
            if (employeeUser.RoleId == 0)
            {
                webpages_Roles role = RolesRepositories.GetEmployeeRole();
                employeeUser.RoleId = role.RoleId;
            }

            EmployeesRepositories.InsertNewEmployee(employee);
            RolesRepositories.CreateUser(userId, employeeUser.RoleId);
        }
示例#9
0
        public static void UpdateEmployee(UserData employee)
        {
            DateTime             todayDate = DateTimeHelper.Today();
            EmployeeUsersDetails model     = new EmployeeUsersDetails
            {
                UserId         = employee.Id,
                EmployeeId     = employee.EmployeeId,
                FirstName      = employee.FirstName,
                LastName       = employee.LastName,
                Email          = employee.Email,
                Address        = employee.Address,
                Phone1         = employee.Phone1,
                Phone2         = employee.Phone2,
                CurrentSalary  = employee.CurrentSalary,
                PreviousSalary = employee.PreviousSalary,
                JoinDate       = employee.JoinDate,
                ImgURL         = employee.ProfilePictureUrl,
                BirthDate      = employee.BirthDate,
            };

            EmployeesRepositories.UpdateEmployee(model, todayDate);
        }
示例#10
0
 public static ChangePasswordDetails GetChangePasswordModel(int userId)
 {
     return(EmployeesRepositories.GetEmployeePasswordDetails(userId));
 }
示例#11
0
 public static List <UserData> GetAllAdminEmployees()
 {
     return(EmployeesRepositories.GetAllAdminEmoloyees());
 }
示例#12
0
 public static List <UserData> GetEmployeesExceptAdmin()
 {
     return(EmployeesRepositories.GetEmployeesExceptAdmin());
 }
示例#13
0
        public static List <UserBirthdayDetails> GetMonthlyBirthday()
        {
            var userHistoryList = EmployeesRepositories.GetMonthlyBirthday(DateTimeHelper.Today().Month);

            return(userHistoryList);
        }
示例#14
0
 public static void LockEmployee(int userId)
 {
     EmployeesRepositories.LockEmployee(userId);
 }
示例#15
0
 public static void DeleteEmployee(int userId)
 {
     EmployeesRepositories.DeleteEmployee(userId);
 }