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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
 public ActionResult Edit(int id, Format format)
 {
     try
     {
         // TODO: Add update logic here
         FormatManager.Update(format);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
示例#4
0
 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));
     }
 }
示例#5
0
 // PUT: api/Format/5
 public void Put(int id, [FromBody] Format format)
 {
     FormatManager.Update(format);
 }
示例#6
0
 // PUT: api/Format/5
 public void Put(int id, [FromBody] Format program)
 {
     FormatManager.Update(program);
 }