public ActionResult GetVehicleSeatingChartPositionedUser(string Id) { eTracLoginModel ObjLoginModel = null; long LocationId = 0; var details = new UserListViewEmployeeManagementModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); if (ObjLoginModel != null) { LocationId = Convert.ToInt32(ObjLoginModel.LocationID); } } var id = Cryptography.GetDecryptedData(Id, true); long _UserId = 0; long.TryParse(id, out _UserId); var data = _IePeopleManager.GetVCSPositionByUserId(_UserId); if (data != null) { return(Json(data, JsonRequestBehavior.AllowGet)); } else { return(Json(data, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// Created By : Ashwajit Bansod /// Created Date : 04-Oct-2019 /// Created /// </summary> /// <param name="UserId"></param> /// <returns></returns> public UserListViewEmployeeManagementModel GetVCSPositionByUserId(long?UserId) { var _ePeopleRepository = new ePeopleRepository(); var getDetails = new UserListViewEmployeeManagementModel(); try { if (UserId > 0) { var getUserDetails = objworkorderEMSEntities.UserRegistrations.Where(x => x.UserId == UserId && x.IsEmailVerify == true && x.IsDeleted == false).FirstOrDefault(); if (getUserDetails != null) { var data = _ePeopleRepository.UserPositionVCS(getUserDetails.EmployeeID); if (data != null) { getDetails.JobTitleId = data.EMP_JobTitleId; getDetails.VSTId = data.JBT_VST_Id; getDetails.EmployeeId = data.EMP_EmployeeID; } } } return(getDetails); } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public List<UserModelList> GetUserHeirarchyList(long? LocationId)", "Exception While getting list User.", UserId); throw; } }
public List <UserListViewEmployeeManagementModel> GetUserTreeViewListTesting(long UserId) { var _ePeopleRepository = new ePeopleRepository(); var lstDetails = new List <UserListViewEmployeeManagementModel>(); var UserModel = new UserListViewEmployeeManagementModel(); try { if (UserId > 0) { var getUserDetails = objworkorderEMSEntities.UserRegistrations.Where(x => x.UserId == UserId && x.IsEmailVerify == true && x.IsDeleted == false).FirstOrDefault(); if (getUserDetails != null) { lstDetails = _ePeopleRepository.UserTreeViewDetails(getUserDetails.EmployeeID).Select(x => new UserListViewEmployeeManagementModel() { EmployeeId = x.EMP_EmployeeID, EmployeeName = x.EmployeeName, JobTitle = x.JBT_JobTitle, LocationId = x.EMP_LocationId, JobTitleId = x.EMP_JobTitleId, ProfilePhoto = x.EMP_Photo == null ? HostingPrefix + ProfilePicPath.Replace("~", "") + "no-profile-pic.jpg" : HostingPrefix + ProfilePicPath.Replace("~", "") + x.EMP_Photo }).ToList(); } } } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public List<UserModelList> GetUserHeirarchyList(long? LocationId)", "Exception While getting list User.", UserId); throw; } return(lstDetails); }
/// <summary> /// Created By :Ashwajit Bansod /// Created Date : 04-Oct-2019 /// Created For : To get User Details By User id /// </summary> /// <param name="LocationId"></param> /// <param name="UserId"></param> /// <returns></returns> public List <UserListViewEmployeeManagementModel> GetUserListByUserId(long?LocationId, long?UserId) { var _ePeopleRepository = new ePeopleRepository(); var lstDetails = new List <UserListViewEmployeeManagementModel>(); var UserModel = new UserListViewEmployeeManagementModel(); try { if (UserId > 0) { var getUserDetails = objworkorderEMSEntities.UserRegistrations.Where(x => x.UserId == UserId && x.IsEmailVerify == true && x.IsDeleted == false).FirstOrDefault(); if (getUserDetails != null) { var selfData = _ePeopleRepository.GetUserSelfDetailsByUserId(getUserDetails.EmployeeID); if (selfData != null) { UserModel.DepartmentName = selfData.DepartmentName; UserModel.EmployeeId = selfData.EMP_EmployeeID; UserModel.EmployeeName = selfData.EmployeeName; UserModel.JobDesc = selfData.VST_JobDescription; UserModel.JobTitle = selfData.JBT_JobTitle; UserModel.LocationId = selfData.EMP_LocationId; UserModel.LocationName = selfData.LocationName; UserModel.JobTitleId = selfData.EMP_JobTitleId; UserModel.ProfilePhoto = selfData.EMP_Photo; string[] JobTitleList = UserModel.JobDesc.Split('|'); List <string> myCollection = new List <string>(); foreach (string title in JobTitleList) { if (title != " " && title != "") { myCollection.Add(title); } UserModel.JobDescList = myCollection; } lstDetails.Add(UserModel); //lstDetails.Add(item); } var data = _ePeopleRepository.GetUserListByUserId(getUserDetails.EmployeeID).Select(x => new UserListViewEmployeeManagementModel() { DepartmentName = x.DepartmentName, EmployeeId = x.EMP_EmployeeID, EmployeeName = x.EmployeeName, JobDesc = x.VST_JobDescription, JobTitle = x.JBT_JobTitle, LocationId = x.EMP_LocationId, LocationName = x.LocationName, JobTitleId = x.EMP_JobTitleId, ProfilePhoto = x.EMP_Photo }).ToList(); foreach (var item in data) { string[] JobTitleList = item.JobDesc.Split('|'); List <string> myCollection = new List <string>(); foreach (string title in JobTitleList) { if (title != " " && title != "") { myCollection.Add(title); } item.JobDescList = myCollection; } lstDetails.Add(item); } } return(lstDetails); } } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public List<UserListViewEmployeeManagementModel> GetUserList(long? LocationId, long? UserId)", "Exception While getting list User.", LocationId); throw; } return(lstDetails); }