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);
        }
예제 #2
0
 public ActionResult Delete(int id, Format format)
 {
     try
     {
         // TODO: Add delete logic here
         FormatManager.Delete(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #3
0
 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());
     }
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
 // DELETE: api/Format/5
 public void Delete(int id)
 {
     FormatManager.Delete(id);
 }