public void InsertTest() { Rating rating = new Rating(); rating.Description = "Bananas"; Assert.IsTrue(RatingManager.Insert(rating) > 0); }
public void InsertTest() { Rating rating = new Rating { Description = "new description" }; Assert.AreNotEqual(0, RatingManager.Insert(rating)); }
public void InsertTest() { Rating rating = new Rating(); rating.Description = "X"; bool result = RatingManager.Insert(rating); Assert.IsTrue(result); }
public ActionResult Create(Rating rating) { try { // TODO: Add insert logic here RatingManager.Insert(rating); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(Rating rating) { try { // TODO: Add insert logic here RatingManager.Insert(rating); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Message = ex.Message; return(View(rating)); } }
protected void btnInsert_Click(object sender, EventArgs e) { try { item = new Rating(); //Assign the property values item.Description = txtDescription.Text; //use the manager to add a row int results = RatingManager.Insert(item); Response.Write("Inserted " + results + " rows..."); } catch (Exception ex) { Response.Write(ex.Message); } }
protected void btnInsert_Click(object sender, EventArgs e) { try { rating = new Rating(); // Get the typed description from the screen rating.Description = txtDescription.Text; // Add to the database RatingManager.Insert(rating); // Add to the list ratings.Add(rating); Rebind(); } catch (Exception ex) { Response.Write("Error: " + ex.Message); } }
// POST: api/Rating public void Post([FromBody] Rating rating) { RatingManager.Insert(rating); }