Example #1
0
        public IHttpActionResult PostTBL_SORUN_(TBL_SORUN_ tBL_SORUN_)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.TBL_SORUN_.Add(tBL_SORUN_);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (TBL_SORUN_Exists(tBL_SORUN_.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = tBL_SORUN_.Id }, tBL_SORUN_));
        }
Example #2
0
        public IHttpActionResult PutTBL_SORUN_(int id, TBL_SORUN_ tBL_SORUN_)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            TBL_SORUN_ tBL_SORUN_ = db.TBL_SORUN_.Find(id);

            db.TBL_SORUN_.Remove(tBL_SORUN_);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "Id,Yetkili,Bolge,Aciklama")] TBL_SORUN_ tBL_SORUN_)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tBL_SORUN_).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tBL_SORUN_));
 }
Example #5
0
        public IHttpActionResult GetTBL_SORUN_(int id)
        {
            TBL_SORUN_ tBL_SORUN_ = db.TBL_SORUN_.Find(id);

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

            return(Ok(tBL_SORUN_));
        }
Example #6
0
        public ActionResult Create([Bind(Include = "Id,Yetkili,Bolge,Aciklama")] TBL_SORUN_ tBL_SORUN_)
        {
            if (ModelState.IsValid)
            {
                db.TBL_SORUN_.Add(tBL_SORUN_);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tBL_SORUN_));
        }
Example #7
0
        public IHttpActionResult DeleteTBL_SORUN_(int id)
        {
            TBL_SORUN_ tBL_SORUN_ = db.TBL_SORUN_.Find(id);

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

            db.TBL_SORUN_.Remove(tBL_SORUN_);
            db.SaveChanges();

            return(Ok(tBL_SORUN_));
        }
Example #8
0
        // GET: SorunTable/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TBL_SORUN_ tBL_SORUN_ = db.TBL_SORUN_.Find(id);

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