Esempio n. 1
0
        public IHttpActionResult PutSCCMWindowsWorkstation(int id, SCCMWindowsWorkstation sCCMWindowsWorkstation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != sCCMWindowsWorkstation.ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 2
0
        public IHttpActionResult PostSCCMWindowsWorkstation(SCCMWindowsWorkstation sCCMWindowsWorkstation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.SCCMWindowsWorkstations.Add(sCCMWindowsWorkstation);
            db.SaveChanges();

            return(Ok(sCCMWindowsWorkstation));
        }
Esempio n. 3
0
        public IHttpActionResult DeleteSCCMWindowsWorkstation(int id)
        {
            SCCMWindowsWorkstation sCCMWindowsWorkstation = db.SCCMWindowsWorkstations.Find(id);

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

            db.SCCMWindowsWorkstations.Remove(sCCMWindowsWorkstation);
            db.SaveChanges();

            return(Ok(sCCMWindowsWorkstation));
        }