Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
 public static async Task FullyEditAdmin(Admins admin)
 {
     await EditAdmin(admin);
     await LoadAdmins();
 }
Exemple #5
0
 public static async Task FullyRemoveAdmin(Admins admin)
 {
     await RemoveAdmin(admin);
     await RemoveAdminIcon(admin);
     await LoadAdmins();
 }
Exemple #6
0
        public static async Task <HttpResponseMessage> RemoveAdmin(Admins admin)
        {
            HttpClient client = new HttpClient();

            return(await client.DeleteAsync(LINK + ADMINS + "/" + admin.ID));
        }