public void Delete_Returns_True_If_Deleted_Existing() { Format f = new Format(); f.Description = "Test Delete"; int id = manager.Create(f); bool actual = manager.Delete(id); Assert.IsTrue(actual); }
public ActionResult Delete(int id, Format format) { try { // TODO: Add delete logic here FormatManager.Delete(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here FormatManager.Delete(id); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.message = ex.Message; return(View()); } }
protected void btnDelete_Click(object sender, EventArgs e) { try { //get the selected degreetype object that i want to use item = items[ddlExisting.SelectedIndex]; //delete it from the database int results = FormatManager.Delete(item.Id); //remove it from degreeTypes items.Remove(item); //rebind Rebind(); Response.Write("Deleted " + results + " rows..."); } catch (Exception ex) { Response.Write(ex.Message); } }
// DELETE: api/Format/5 public void Delete(int id) { FormatManager.Delete(id); }