public IHttpActionResult Puttbld_cluster(int id, tbld_cluster tbld_cluster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "id,name,code,description")] tbld_cluster tbldCluster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbldCluster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbldCluster));
 }
        public IHttpActionResult Gettbld_cluster(int id)
        {
            tbld_cluster tbld_cluster = db.tbld_cluster.Find(id);

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

            return(Ok(tbld_cluster));
        }
예제 #4
0
        public ActionResult Create([Bind(Include = "id,name,code,description")] tbld_cluster tbldCluster)
        {
            if (ModelState.IsValid)
            {
                db.tbld_cluster.Add(tbldCluster);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tbldCluster));
        }
예제 #5
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbld_cluster tbldCluster = db.tbld_cluster.Find(id);

            if (tbldCluster != null)
            {
                db.tbld_cluster.Remove(tbldCluster);
            }
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public IHttpActionResult Posttbld_cluster(tbld_cluster tbld_cluster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tbld_cluster.Add(tbld_cluster);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tbld_cluster.id }, tbld_cluster));
        }
        public IHttpActionResult Deletetbld_cluster(int id)
        {
            tbld_cluster tbld_cluster = db.tbld_cluster.Find(id);

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

            db.tbld_cluster.Remove(tbld_cluster);
            db.SaveChanges();

            return(Ok(tbld_cluster));
        }
예제 #8
0
        // GET: DBhouseCluster/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbld_cluster tbldCluster = db.tbld_cluster.Find(id);

            if (tbldCluster == null)
            {
                return(HttpNotFound());
            }
            return(View(tbldCluster));
        }