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);
 }