public static AdminUserCollection GetUsersByType(Registry registry, AdminUserType adminUserType) { AdminUserCollection adminUserCollection = new AdminUserCollection(registry); SqlProcedureCommand call = new SqlProcedureCommand(); call.ProcedureName = "AdminUser_LoadByAdminUserType"; call.AddInt32("AdminUserType", (int)adminUserType); adminUserCollection.Load(call, "AdminUserId", true, true, false); return(adminUserCollection); }
public AdminUserEntity GetAdminUser(int userGuid) { var filter = new PredicateExpression(); filter.AddWithAnd(AdminUserFields.UserGuid == userGuid); var userCollection = new AdminUserCollection(); userCollection.GetMulti(filter); return(userCollection.FirstOrDefault()); }
public static AdminUserCollection GetUsersActiveAndReceivesPastDueNotifications(Registry registry) { AdminUserCollection adminUserCollection = new AdminUserCollection(registry); adminUserCollection.Load(new SqlProcedureCommand() { ProcedureName = "AdminUser_LoadByActiveAndReceivesPastDueNotifications" }, "AdminUserId", true, true); return(adminUserCollection); }
public static AdminUserCollection Search(Registry registry, string orderBy, NullableBoolean getDeletedUsers, bool includeActiveUsers, bool includeInactiveUsers, int sortDirection, int currentPage, int pageSize) { AdminUserCollection adminUserCollection = new AdminUserCollection(registry); SqlProcedureCommand call = new SqlProcedureCommand(); call.ProcedureName = "AdminUser_LoadBySearch"; call.AddNVarChar("OrderBy", orderBy); if (!getDeletedUsers.IsNull) { call.AddBoolean("IsDeleted", getDeletedUsers.Value); } call.AddBoolean("IncludeActiveUsers", includeActiveUsers); call.AddBoolean("IncludeInactiveUsers", includeInactiveUsers); call.AddInt32("SortDirection", sortDirection); call.AddInt32("CurrentPage", currentPage); call.AddInt32("PageSize", pageSize); adminUserCollection.Load(call, "AdminUserId", true, true, true); return(adminUserCollection); }
public static void SetValidationTestResultPaymentAmounts(AdminUserCollection usersToUpdate, NullableDateTime submittedStartDateUTC, NullableDateTime submittedEndDateUTC) { using (SqlDataReaderWrapper dataReaderWrapper = new SqlDataReaderWrapper(usersToUpdate.Registry.ConnectionStringDefault)) { dataReaderWrapper.ProcedureName = "AdminUser_GetValidationTestResultPaymentAmounts"; dataReaderWrapper.AddNVarChar("AdminUserXmlGuidList", usersToUpdate.ToXmlGuidList()); dataReaderWrapper.AddDateTime("SubmittedStartDateUTC", submittedStartDateUTC); dataReaderWrapper.AddDateTime("SubmittedEndDateUTC", submittedEndDateUTC); dataReaderWrapper.Execute(); while (dataReaderWrapper.Read()) { AdminUser byProperty = (AdminUser)usersToUpdate.FindByProperty("Id", (object)dataReaderWrapper.GetGuid("AdminUserId")); if (byProperty != null) { byProperty.ValidationTestResultsTotalMinutesToComplete = dataReaderWrapper.GetInt32("ValidationTestResultsTotalMinutesToComplete"); byProperty.ValidationTestResultsPaymentAmount = byProperty.ValidationPayRateDollarsPerHour * (NullableDecimal)((Decimal)byProperty.ValidationTestResultsTotalMinutesToComplete / new Decimal(60)); } } } }
public AdminUserCollection GetAdminUserCollection(SiteAdminTypeEnum adminSiteType, string userName, string email, string token) { var userCollection = new AdminUserCollection(); if (string.IsNullOrEmpty(userName) && string.IsNullOrEmpty(email) && string.IsNullOrEmpty(token)) { return(userCollection); } var filter = new PredicateExpression(); var relations = new RelationCollection(); if (adminSiteType == SiteAdminTypeEnum.Accumolo) { relations.Add(AdminUserEntityBase.Relations.AdminUserAccessEntityUsingUserGuid); relations.Add(AdminUserAccessEntityBase.Relations.AdminSiteModuleEntityUsingSiteModuleGuid); relations.Add(AdminSiteModuleEntityBase.Relations.AdminSitesEntityUsingSiteGuid); filter.AddWithAnd(AdminSitesFields.AccountingMarkAsInactive != 1); } else if (adminSiteType == SiteAdminTypeEnum.Management) { filter.Add(AdminUserFields.UserManagementAccess == true); } if (!string.IsNullOrEmpty(userName)) { filter.AddWithAnd(AdminUserFields.UserName == userName); } if (!string.IsNullOrEmpty(email)) { filter.AddWithAnd(AdminUserFields.UserEmail == email); } if (!string.IsNullOrEmpty(token)) { filter.AddWithAnd(AdminUserFields.UserPasswordResetToken == token); filter.AddWithAnd(AdminUserFields.TokenExpiration >= DateTime.Now); } userCollection.GetMulti(filter, relations); return(userCollection); }
public HomeController(IUserContext usercontext, ICaseContext caseContext, IAdminUserContext adminUserContext) { serverUserCollection = new AdminUserCollection(adminUserContext); Case = new Logic.Case(caseContext); CaseCollection = new CaseCollection(caseContext); }
public static List <DiagnosticReportOBDFixAdminUserStatistics> GetOBDFixStats(Registry registry, AdminUserCollection users, DateTime?startDateTimeUTC, DateTime?endDateTimeUTC) { List <DiagnosticReportOBDFixAdminUserStatistics> adminUserStatisticsList = new List <DiagnosticReportOBDFixAdminUserStatistics>(); foreach (AdminUser user in (CollectionBase)users) { using (SqlDataReaderWrapper dataReaderWrapper = new SqlDataReaderWrapper(registry.ConnectionStringDefault)) { dataReaderWrapper.ProcedureName = "DiagnosticReportFixFeedback_GetAdminUserStats"; dataReaderWrapper.AddGuid("AdminUserId", user.Id); if (startDateTimeUTC.HasValue) { dataReaderWrapper.AddDateTime("StartDateTimeUTC", startDateTimeUTC.Value); } if (endDateTimeUTC.HasValue) { dataReaderWrapper.AddDateTime("EndDateTimeUTC", endDateTimeUTC.Value); } dataReaderWrapper.Execute(); if (dataReaderWrapper.Read()) { DiagnosticReportOBDFixAdminUserStatistics adminUserStatistics = new DiagnosticReportOBDFixAdminUserStatistics(user, dataReaderWrapper.GetInt32("ReportsClosedNewFixAdded"), dataReaderWrapper.GetInt32("ReportsClosedExistingFixSelected"), dataReaderWrapper.GetInt32("ReportsClosedRejected"), dataReaderWrapper.GetInt32("NumOfFixesFromFixReport"), dataReaderWrapper.GetInt32("NumOfDirectFixes")); adminUserStatisticsList.Add(adminUserStatistics); } } } return(adminUserStatisticsList); }
//private UserCollection _userCollection; public UserController(IUserContext userContext, IAdminUserContext adminUserContext) { _adminUserCollection = new AdminUserCollection(adminUserContext); _companyUserCollection = new CompanyUserCollection(userContext); //_userCollection = new UserCollection(userContext); }