Exemple #1
0
        public IHttpActionResult PutAbuserRelationship(int id, AbuserRelationship abuserRelationship)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != abuserRelationship.AbuserRelationshipId)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            AbuserRelationship abuserRelationship = db.AbuserRelationships.Find(id);

            db.AbuserRelationships.Remove(abuserRelationship);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #3
0
 public ActionResult Edit([Bind(Include = "AbuserRelationshipId,Relationship")] AbuserRelationship abuserRelationship)
 {
     if (ModelState.IsValid)
     {
         db.Entry(abuserRelationship).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(abuserRelationship));
 }
Exemple #4
0
        public ActionResult Create([Bind(Include = "AbuserRelationshipId,Relationship")] AbuserRelationship abuserRelationship)
        {
            if (ModelState.IsValid)
            {
                db.AbuserRelationships.Add(abuserRelationship);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(abuserRelationship));
        }
Exemple #5
0
        public IHttpActionResult GetAbuserRelationship(int id)
        {
            AbuserRelationship abuserRelationship = db.AbuserRelationships.Find(id);

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

            return(Ok(abuserRelationship));
        }
Exemple #6
0
        public IHttpActionResult PostAbuserRelationship(AbuserRelationship abuserRelationship)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.AbuserRelationships.Add(abuserRelationship);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = abuserRelationship.AbuserRelationshipId }, abuserRelationship));
        }
Exemple #7
0
        // GET: AbuserRelationships/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AbuserRelationship abuserRelationship = db.AbuserRelationships.Find(id);

            if (abuserRelationship == null)
            {
                return(HttpNotFound());
            }
            return(View(abuserRelationship));
        }
Exemple #8
0
        public IHttpActionResult DeleteAbuserRelationship(int id)
        {
            AbuserRelationship abuserRelationship = db.AbuserRelationships.Find(id);

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

            db.AbuserRelationships.Remove(abuserRelationship);
            db.SaveChanges();

            return(Ok(abuserRelationship));
        }