public IHttpActionResult PutConsultancies(int id, Consultancies consultancies)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != consultancies.Id)
            {
                return BadRequest();
            }

            db.Entry(consultancies).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ConsultanciesExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
        public IHttpActionResult PutConsultancies(int id, Consultancies consultancies)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != consultancies.Id)
            {
                return(BadRequest());
            }

            db.Entry(consultancies).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ConsultanciesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetConsultancies(int id)
        {
            Consultancies consultancies = db.Consultancies.Find(id);

            if (consultancies == null)
            {
                return(NotFound());
            }

            return(Ok(consultancies));
        }
        public IHttpActionResult PostConsultancies(Consultancies consultancies)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.Consultancies.Add(consultancies);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = consultancies.Id }, consultancies);
        }
        public IHttpActionResult PostConsultancies(Consultancies consultancies)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Consultancies.Add(consultancies);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = consultancies.Id }, consultancies));
        }
 public bool PutUpdateStandards([FromBody] Consultancies consultancies)
 {
     try
     {
         gestaoDeConsultoriaAcessoria.Update(consultancies);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
 public bool PostConsultancies([FromBody] Consultancies consultancies)
 {
     try
     {
         gestaoDeConsultoriaAcessoria.Add(consultancies);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
        public IHttpActionResult DeleteConsultancies(int id)
        {
            Consultancies consultancies = db.Consultancies.Find(id);

            if (consultancies == null)
            {
                return(NotFound());
            }

            db.Consultancies.Remove(consultancies);
            db.SaveChanges();

            return(Ok(consultancies));
        }
Exemplo n.º 9
0
 public void Update(Consultancies t)
 {
     db.Entry(t).State = EntityState.Modified;
 }
Exemplo n.º 10
0
 public void Insert(Consultancies t)
 {
     db.Consultancies.Add(t);
 }
Exemplo n.º 11
0
        public void Delete(int id)
        {
            Consultancies c = db.Consultancies.Find(id);

            db.Consultancies.Remove(c);
        }
Exemplo n.º 12
0
 public void Update(Consultancies consultancies)
 {
     _context.Consultancies.Update(consultancies);
     _context.SaveChanges();
 }
Exemplo n.º 13
0
 public void Remove(Consultancies consultancies)
 {
     _context.Consultancies.Remove(consultancies);
     _context.SaveChanges();
 }
Exemplo n.º 14
0
 public void Add(Consultancies consultancies)
 {
     _context.Consultancies.Add(consultancies);
     _context.SaveChanges();
 }
Exemplo n.º 15
0
        public async Task AddAsync(Consultancies consultancies)
        {
            await _context.Consultancies.AddAsync(consultancies);

            await _context.SaveChangesAsync();
        }