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

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