Exemple #1
0
        /// <summary>AssignLocationToEmployeeUser
        /// <CreatedOn>Sep-14-2016</CreatedOn>
        /// <CreatedBy>Bhushan Dod</CreatedBy>
        /// </summary>
        /// <param name="LocationId"></param>
        /// <param name="AdminUserId"></param>
        public void AssignLocationToEmployeeUser(long locationId, long empUserId)
        {
            try
            {
                if (locationId > 0 && empUserId > 0)
                {
                    objEmployeeLocationMappingRepository = new EmployeeLocationMappingRepository();
                    EmployeeLocationMapping ObjEmployeeLocationMapping;
                    ObjEmployeeLocationMapping = objEmployeeLocationMappingRepository.GetSingleOrDefault(mapp => mapp.LocationId == locationId && mapp.EmployeeUserId == empUserId && mapp.IsDeleted == false);

                    if (ObjEmployeeLocationMapping != null)
                    {
                        ObjEmployeeLocationMapping                = new EmployeeLocationMapping();
                        ObjEmployeeLocationMapping.LocationId     = locationId;
                        ObjEmployeeLocationMapping.EmployeeUserId = empUserId;
                        // ObjEmployeeLocationMapping. = empUserId;
                        ObjEmployeeLocationMapping.CreatedBy = empUserId;
                        ObjEmployeeLocationMapping.CreatedOn = DateTime.UtcNow;
                        objEmployeeLocationMappingRepository.Add(ObjEmployeeLocationMapping);
                    }
                }
                else
                {
                    Exception_B.Exception_B.exceptionHandel_Runtime(new Exception("You are not allowed to assgin employee user to location 0. Means Location 0 is not allowed"), "public void AssignLocationToAdminUser(long locationId, long adminUserId)", "Exception from c#", "adminUserId:-" + empUserId + "," + "locationId:-" + locationId);
                }
            }
            catch (Exception)
            { throw; }
        }
Exemple #2
0
        /// <summary>
        /// TO GET FULL DETAIL FULL DETAIL OF THE EMPLOYEE
        /// </summary>
        /// <CreatedBy>Manoj jaswal</CreatedBy>
        /// <CreatedDate>2015-03-18</CreatedDate>
        /// <param name="Loc_ID"></param>
        /// <returns></returns>
        public List <EmployeeModel> GetEmployeeByLocDetailed(long Loc_ID)
        {
            EmployeeLocationMappingRepository obj_EmployeeLocationMappingRepository = new EmployeeLocationMappingRepository();

            return(obj_EmployeeLocationMappingRepository.GetEmployeeByLocDetailed(Loc_ID).Select(x => new EmployeeModel()
            {
                UserId = Convert.ToInt64(x.UserId),
                Password = x.Password,
                UserEmail = x.UserEmail,
                AlternateEmail = x.AlternateEmail,
                SubscriptionEmail = x.SubscriptionEmail,
                UserType = Convert.ToInt64(x.UserType),
                ProjectID = x.ProjectID,
                FirstName = x.FirstName,
                LastName = x.LastName,
                Gender = x.Gender,
                DOB = Convert.ToDateTime(x.DOB).ToString("MM/dd/yy"),
                ProfileImage = x.ProfileImage,
                IsLoginActive = Convert.ToBoolean(x.IsLoginActive),
                IsEmailVerify = Convert.ToBoolean(x.IsEmailVerify),
                TimeZoneId = x.TimeZoneId,
                VendorID = x.VendorID,
                BloodGroup = x.BloodGroup,
                HiringDate = x.HiringDate,
                EmployeeCategory = x.EmployeeCategory,
                QRCID = x.QRCID,
                EmployeeID = x.EmployeeID,
                JobTitle = x.JobTitle,
                DeviceId = x.DeviceId,
                DeviceType = x.DeviceType,
                ServiceAuthKey = x.ServiceAuthKey,
                EmployeeLocationMappingId = x.EmployeeLocationMappingId,
                EmployeeUserId = x.EmployeeUserId,
                LocationId = x.LocationId,
                AddressMasterId = x.AddressMasterId,
                Address1 = x.Address1,
                Address2 = x.Address2,
                City = x.City,
                StateId = x.StateId,
                CountryId = x.CountryId,
                Mobile = x.Mobile,
                Phone = x.Phone,
                ZipCode = x.ZipCode,
                IsCurrentAddress = x.IsCurrentAddress,
                IsPermanent = x.IsPermanent,
            }).ToList());
        }
Exemple #3
0
        /// <summary>
        /// Created By: Ashwajit Bansod
        /// Created Date: Aug-13-2018
        /// Created For : To fetch Employee Data from User Registration Table
        /// </summary>
        /// <param name="objManagerAppModel"></param>
        /// <returns></returns>
        public List <EmployeeListModel> EmployeeList(ManagerAppModel objManagerAppModel)
        {
            workorderEMSEntities _workorderEMSEntities = new workorderEMSEntities();
            var listEmployee = new List <EmployeeListModel>();

            try
            {
                long UnAssignedId  = Convert.ToInt64(DashboardWidget.UnAssignedWorkOrder);
                long PriorityLevel = Convert.ToInt64(WorkRequestPriority.Level1Urgent);
                var  empManager    = new EmployeeManager();
                var  userData      = _workorderEMSEntities.UserRegistrations.Where(x => x.ServiceAuthKey == objManagerAppModel.ServiceAuthKey &&
                                                                                   x.IsDeleted == false).FirstOrDefault();
                if (userData != null)
                {
                    //var UserInRole = _workorderEMSEntities.UserRegistrations.
                    //Join(_workorderEMSEntities.AdminLocationMappings, u => u.UserId, uir => uir.AdminUserId,
                    //(u, uir) => new { u, uir }).
                    //Join(_workorderEMSEntities.LoginLogs, r => r.uir.AdminUserId, ro => ro.UserID, (r, ro) => new { r, ro })
                    //.Where(m => m.r.u.UserType == 3
                    //       && m.r.u.IsEmailVerify == true
                    //       && m.r.u.IsDeleted == false
                    //       && m.r.u.IsLoginActive == true
                    //       && m.r.uir.LocationId == objManagerAppModel.LocationId
                    //       && m.ro.IsActive == true)
                    //.Select(ls => new EmployeeListModel()
                    //{
                    //    EmployeeId = ls.r.u.EmployeeID,
                    //    LocationId = ls.r.uir.LocationId,
                    //    ProfileImage = ls.r.u.ProfileImage,
                    //    UserId = ls.r.u.UserId,
                    //    UserName = ls.r.u.FirstName + " " + ls.r.u.LastName
                    //}).ToList();
                    EmployeeLocationMappingRepository obj_EmployeeLocationMappingRepository = new EmployeeLocationMappingRepository();
                    listEmployee = obj_EmployeeLocationMappingRepository.GetActiveEmployeeByLocDetailed(objManagerAppModel.LocationId)
                                   .Select(ls => new EmployeeListModel()
                    {
                        EmployeeId   = ls.EmployeeID,
                        LocationId   = objManagerAppModel.LocationId,
                        ProfileImage = ls.ProfileImage == null ? HostingPrefix + ProfileImagePath.Replace("~", "") + "no-profile-pic.jpg" : HostingPrefix + ProfileImagePath.Replace("~", "") + ls.ProfileImage,
                        UserId       = ls.UserId,
                        UserName     = ls.FirstName + " " + ls.LastName
                    }).ToList();

                    //         listEmployee = empManager.GetEmployeeByLocDetailed(objManagerAppModel.LocationId)
                    //.Select( ls => new EmployeeListModel()
                    //{
                    //    EmployeeId  = ls.EmployeeID,
                    //    LocationId = ls.LocationId,
                    //    ProfileImage = ls.ProfileImage,
                    //    UserId = ls.UserId,
                    //    UserName = ls.FirstName + " " + ls.LastName
                    //}).ToList();
                }
            }
            catch (Exception ex)
            {
                Exception_B.Exception_B.exceptionHandel_Runtime(ex, "List<EmployeeListModel> EmployeeList(ManagerAppModel objManagerAppModel)", "Exception While Listing Employee For Assigning Work order.", objManagerAppModel.LocationId);
                throw;
            }
            return(listEmployee);
        }