Esempio n. 1
0
        public ActionResult Create([Bind(Include = "OrderID,OrderType,Description,Priority,State,Posology,Date,PatientID")] OrderEntity orderEntity)
        {
            if (ModelState.IsValid)
            {
                db.Add(orderEntity);

                return(RedirectToAction("Index"));
            }

            ViewBag.PatientID = new SelectList(pf.ToList(), "PatientID", "Name", orderEntity.PatientID);
            return(View(orderEntity));
        }
        public IHttpActionResult PostOrderEntity(OrderEntity orderEntity)
        {
            bool respont = db.Add(orderEntity);

            if (respont)
            {
                return(CreatedAtRoute("DefaultApi", new { id = orderEntity.OrderID }, orderEntity));
            }
            else
            {
                return(BadRequest(ModelState));
            }
        }