Пример #1
0
        public async void GetItems()
        {
            HttpClient client            = new HttpClient();
            var        dashboardEndpoint = ConstantsValue.MainAddress + ConstantsValue.AllItems;

            client.DefaultRequestHeaders.Clear();
            client.DefaultRequestHeaders.Add("Authorization", ConstantsValue.userprofile.token);

            var result = await client.GetStringAsync(dashboardEndpoint);

            var ItemsList = JsonConvert.DeserializeObject <List <ItemsModel> >(result);

            Items = new ObservableCollection <ItemsModel>(ItemsList);


            ConstantsValue.itemslist = ItemsList;

            if (ConstantsValue.itemslist == null)
            {
                Emplist.ItemsSource = Items;
                Emplist.EndRefresh();
            }
            else if (ConstantsValue.itemslist != null)
            {
                Emplist.ItemsSource = null;
                //Emplist.IsVisible = false;
                Emplist.ItemsSource = ConstantsValue.itemslist;
                Emplist.EndRefresh();
                //Emplist.BeginRefresh();


                //Emplist.EndRefresh();
            }
        }
        public async Task <ActionResult <Emplist> > PostEmplist(Emplist emplist)
        {
            _context.Emplists.Add(emplist);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEmplist", new { id = emplist.Id }, emplist));
        }
        public async Task <IActionResult> Putemplist(long id, Emplist emplist)
        {
            if (id != emplist.Id)
            {
                return(BadRequest());
            }

            _context.Entry(emplist).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EmplistExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #4
0
 protected void PageRefreshing(object sender, EventArgs e)
 {
     GetUsers();
     Emplist.EndRefresh();
 }
Пример #5
0
 public void ItemRefreshing(object sender, EventArgs e)
 {
     GetItems();
     Emplist.EndRefresh();
 }
Пример #6
0
 protected void ComponentRefreshing(object sender, EventArgs e)
 {
     GetComponents();
     Emplist.EndRefresh();
 }
Пример #7
0
 public void EditItemRefreshing(object sender, EventArgs e)
 {
     LoadItemPrice(myId);
     Emplist.EndRefresh();
 }