public static List <Products> _a(Admins a) { var list = new List <Products>(); foreach (Products p in products) { if (p.AdminID == a.ID) { list.Add(p); } } return(list); }
public static async Task <bool> Check(Admins admin, Page page) { await LoadAdmins(); if (GetAdminById(admin.ID) == null) { await App.Send("Info", "Ert konto har raderats!", "Ok"); await App.LogOut(page); return(true); } return(false); }
public static async Task <AdminIcon> LoadAdminIcon(Admins ad) { HttpClient client = new HttpClient(); try { var responce = await client.GetStringAsync(LINK + AIMAGE + "/" + ad.ID); return(JsonConvert.DeserializeObject <AdminIcon>(responce)); } catch (Exception e) { return(null); } }
public static async Task FullyEditAdmin(Admins admin) { await EditAdmin(admin); await LoadAdmins(); }
public static async Task FullyRemoveAdmin(Admins admin) { await RemoveAdmin(admin); await RemoveAdminIcon(admin); await LoadAdmins(); }
public static async Task <HttpResponseMessage> RemoveAdmin(Admins admin) { HttpClient client = new HttpClient(); return(await client.DeleteAsync(LINK + ADMINS + "/" + admin.ID)); }