public void Update_Returns_Updated_Object() { Format f = new Format(); f.Description = "Update"; f.Id = manager.Create(f); f.Description = "UPDATED"; Format updated = manager.Update(f); Assert.AreEqual("UPDATED", f.Description); }
protected void btnUpdate_Click(object sender, EventArgs e) { try { //get the selected degreetype object that i want to use item = items[ddlExisting.SelectedIndex]; //update degreeType Description item.Description = txtDescription.Text; //delete it from the database int results = FormatManager.Update(item); //update the list with new description items[ddlExisting.SelectedIndex] = item; //rebind Rebind(); Response.Write("Updated " + results + " rows..."); } catch (Exception ex) { Response.Write(ex.Message); } }
public ActionResult Edit(int id, Format format) { try { // TODO: Add update logic here FormatManager.Update(format); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, Format format) { try { // TODO: Add update logic here FormatManager.Update(format); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Message = ex.Message; return(View(format)); } }
// PUT: api/Format/5 public void Put(int id, [FromBody] Format format) { FormatManager.Update(format); }
// PUT: api/Format/5 public void Put(int id, [FromBody] Format program) { FormatManager.Update(program); }