public IActionResult OnPostDeleteUser() { IUser user = UserCatalogue.CurrentUser; user.Delete(); UserCatalogue.Logout(); return(Redirect("~/")); }
public async Task <bool> UserCatalogueFindTest() { UserCatalogue uc = new UserCatalogue(); List <IUser> users = await uc.GetAllItems(); IUser user = users[0]; List <IUser> usersWithKey = await uc.GetItemsWithKey(0, user.Id); string userEmail = user.Email[1..(user.Email.Length - 1)];
public async Task <bool> UserCatalogueReadTest() { UserCatalogue uc = new UserCatalogue(); List <IUser> users = await uc.GetAllItems(); int id = users[0].Id; IUser user = await uc.GetItem(new int[] { id }); return(user.Id == users[0].Id); }
public async Task <bool> UserCatalogueUpdateTest() { UserCatalogue uc = new UserCatalogue(); List <IUser> users = await uc.GetItemsWithAttribute(0, "*****@*****.**"); IUser preUser = users[0]; IUser postUser = new Administrator(preUser.Id, "*****@*****.**", "12345", "5417", "34343260", "Org.Slave Nr. ADM-217"); bool success = await uc.UpdateItem(postUser, new int[] { preUser.Id }); return(success); }
public async Task <List <Participant> > FindSpeakers() { ICatalogue <IUser> catalogue = new UserCatalogue(); List <Participant> participants = new List <Participant>(); foreach (int i in Speakers) { IUser user = await catalogue.GetItem(new int[] { i }); if (user is Participant) { participants.Add((Participant)user); } } return(participants); }
public async Task <bool> UserCatalogueInsertTest() { UserCatalogue uc = new UserCatalogue(); List <IUser> users = await uc.GetAllItems(); int preNr = users.Count; IUser user = new Participant(0, "*****@*****.**", "p455w02d", "5417", "+4512345678", "Test Testersen", new List <Booking>()); await uc.CreateItem(user); users = await uc.GetAllItems(); int postNr = users.Count; return(preNr == postNr - 1); }
public bool Login() { UserCatalogue users = new UserCatalogue(); return(users.Login(Email, Password)); }
public IActionResult OnGet() { UserCatalogue.Logout(); return(RedirectToPage("/Index")); }