Ejemplo n.º 1
0
        public IHttpActionResult PutPTMCalls(int id, PTMCalls pTMCalls)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            PTMCalls pTMCalls = db.ptmCall.Find(id);

            db.ptmCall.Remove(pTMCalls);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "ID,date,Titile,Message,Creater")] PTMCalls pTMCalls)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pTMCalls).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pTMCalls));
 }
Ejemplo n.º 4
0
        public IHttpActionResult GetPTMCalls(int id)
        {
            PTMCalls pTMCalls = db.ptmCall.Find(id);

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

            return(Ok(pTMCalls));
        }
Ejemplo n.º 5
0
        public ActionResult CreatebyAdmin([Bind(Include = "ID,date,Titile,Message,Creater")] PTMCalls pTMCalls)
        {
            if (ModelState.IsValid)
            {
                ViewBag.msg = "Message sent successfully";
                db.ptmCall.Add(pTMCalls);
                db.SaveChanges();
                return(View());
            }

            return(View(pTMCalls));
        }
Ejemplo n.º 6
0
        public IHttpActionResult PostPTMCalls(PTMCalls pTMCalls)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ptmCall.Add(pTMCalls);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = pTMCalls.ID }, pTMCalls));
        }
Ejemplo n.º 7
0
        // GET: PTMCalls/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PTMCalls pTMCalls = db.ptmCall.Find(id);

            if (pTMCalls == null)
            {
                return(HttpNotFound());
            }
            return(View(pTMCalls));
        }
Ejemplo n.º 8
0
        public IHttpActionResult DeletePTMCalls(int id)
        {
            PTMCalls pTMCalls = db.ptmCall.Find(id);

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

            db.ptmCall.Remove(pTMCalls);
            db.SaveChanges();

            return(Ok(pTMCalls));
        }