public void InsertTest() { Format format = new Format(); format.Description = "Bananas"; Assert.IsTrue(FormatManager.Insert(format) > 0); }
public void InsertTest() { Format format = new Format { Description = "JKFL" }; Assert.AreNotEqual(0, FormatManager.Insert(format)); }
public void InsertTest() { Format format = new Format(); format.Description = "Cartrivision"; bool result = FormatManager.Insert(format); Assert.IsTrue(result); }
public ActionResult Create(Format format) { try { // TODO: Add insert logic here FormatManager.Insert(format); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(Format format) { try { // TODO: Add insert logic here FormatManager.Insert(format); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Message = ex.Message; return(View(format)); } }
protected void btnInsert_Click(object sender, EventArgs e) { try { item = new Format(); //Assign the property values item.Description = txtDescription.Text; //use the manager to add a row int results = FormatManager.Insert(item); Response.Write("Inserted " + results + " rows..."); } catch (Exception ex) { Response.Write(ex.Message); } }
// POST: api/Format public void Post([FromBody] Format format) { FormatManager.Insert(format); }
// POST: api/Format public void Post([FromBody] Format program) { FormatManager.Insert(program); }