public void InsertTest()
        {
            DegreeType degreeType = new DegreeType();

            degreeType.Description = "Test Degree Type";

            bool result = degreeType.Insert();

            Assert.IsTrue(result);
        }
 public ActionResult Create(DegreeType degreeType)
 {
     try
     {
         // TODO: Add insert logic here
         degreeType.Insert();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(degreeType));
     }
 }
        protected void btnInsert_Click(object sender, EventArgs e)
        {
            try
            {
                degreeType = new DegreeType();

                degreeType.Description = txtDescription.Text;

                degreeType.Insert();
                degreeTypes.Add(degreeType);
                Session["degreeTypes"] = degreeTypes;
                Rebind();
            }
            catch (Exception ex)
            {
                Response.Write("Error: " + ex.Message);
            }
        }
Exemplo n.º 4
0
 public void Post([FromBody] DegreeType degreetype)
 {
     degreetype.Insert();
 }