internal void Get_Create_Modify_User(Guid createUserId, Guid?modifyUserId, ref UserViewModel createUser, ref UserViewModel modifyUser) { var filters = new List <GenericDataFormat.FilterItems>(); if (createUserId != null) { filters.Add(new GenericDataFormat.FilterItems() { Property = "UserId", Operation = GenericDataFormat.FilterOperations.Equal, Value = createUserId, LogicalOperation = GenericDataFormat.LogicalOperations.Or }); } if (modifyUserId != null) { filters.Add(new GenericDataFormat.FilterItems() { Property = "UserId", Operation = GenericDataFormat.FilterOperations.Equal, Value = createUserId }); } var requestBody = new GenericDataFormat() { Filters = filters }; var users = this.GetView <UserViewModel>(requestBody).PageItems; createUser = users.SingleOrDefault(x => x.UserId == createUserId); if (modifyUserId != null) { modifyUser = users.SingleOrDefault(x => x.UserId == modifyUserId); } }
internal static bool IsAdmin(UserViewModel user) { return(user.UserTypeID == DBEnums.UserType.Admin); }