public ActionResult DeleteConfirmed(int id) { Med_quantity_type med_quantity_type = db.Med_quantity_type.Find(id); db.Med_quantity_type.Remove(med_quantity_type); db.SaveChanges(); return RedirectToAction("Index"); }
// PUT api/MedQuantityTypeApi/5 public async Task <IHttpActionResult> PutMed_quantity_type(int id, Med_quantity_type med_quantity_type) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != med_quantity_type.Med_quan_typeId) { return(BadRequest()); } db.Entry(med_quantity_type).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Med_quantity_typeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task<ActionResult > Edit([Bind(Include = "Med_quan_typeId,Med_quan_type,Med_quantity")] Med_quantity_type med_quantity_type) { if (ModelState.IsValid) { db.Entry(med_quantity_type).State = EntityState.Modified; await db.SaveChangesAsync(); return RedirectToAction("Index"); } return View(med_quantity_type); }
public ActionResult Create([Bind(Include="Med_quan_typeId,Med_quan_type,Med_quantity")] Med_quantity_type med_quantity_type) { if (ModelState.IsValid) { db.Med_quantity_type.Add(med_quantity_type); db.SaveChanges(); return RedirectToAction("Index"); } return View(med_quantity_type); }
public async Task <IHttpActionResult> GetMed_quantity_type(int id) { Med_quantity_type med_quantity_type = await db.Med_quantity_type.FindAsync(id); if (med_quantity_type == null) { return(NotFound()); } return(Ok(med_quantity_type)); }
public async Task <IHttpActionResult> PostMed_quantity_type(Med_quantity_type med_quantity_type) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Med_quantity_type.Add(med_quantity_type); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = med_quantity_type.Med_quan_typeId }, med_quantity_type)); }
// GET: /MedQuantityType/Delete/5 public ActionResult Delete(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Med_quantity_type med_quantity_type = db.Med_quantity_type.Find(id); if (med_quantity_type == null) { return HttpNotFound(); } return View(med_quantity_type); }
// GET: /MedQuantityType/Edit/5 public async Task<ActionResult> Edit(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Med_quantity_type med_quantity_type = await db.Med_quantity_type.FindAsync(id); if (med_quantity_type == null) { return HttpNotFound(); } return PartialView(med_quantity_type); }
public async Task <IHttpActionResult> DeleteMed_quantity_type(int id) { Med_quantity_type med_quantity_type = await db.Med_quantity_type.FindAsync(id); if (med_quantity_type == null) { return(NotFound()); } db.Med_quantity_type.Remove(med_quantity_type); await db.SaveChangesAsync(); return(Ok(med_quantity_type)); }