Exemplo n.º 1
0
        public async Task <IActionResult> PutCoun(string id, Coun coun)
        {
            if (id != coun.CounCode)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 2
0
        void ComboBox_Country_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            IEnumerable <Persons> Coun;
            var _country = ComboBox_Country.SelectedItem;

            if (!isLoad)
            {
                Coun = from i in DonePersons where i.Country == _country select i;
            }
            else
            {
                Coun = from i in lists where i.Country == _country select i;
                var id = from i in lists where !(i.Country.Contains(_country.ToString())) select i;
            }
            CVS.Filter += (p) =>
            {
                foreach (var c in Coun)
                {
                    if (((Persons)p).Country.Equals(c.Country))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                return(false);
            };
            DonePersons = Coun.ToList();
            isLoad      = false;
        }
Exemplo n.º 3
0
        public async Task <ActionResult <Coun> > PostCoun(Coun coun)
        {
            _context.Coun.Add(coun);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (CounExists(coun.CounCode))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetCoun", new { id = coun.CounCode }, coun));
        }