public ActionResult Delete(int id, Rating rating)
 {
     try
     {
         // TODO: Add delete logic here
         rating.Delete();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(rating));
     }
 }
Esempio n. 2
0
        public void DeleteTest()
        {
            RatingList ratings = new RatingList();

            ratings.Load();

            //Find the rating with the description testingrating
            Rating rating = ratings.FirstOrDefault(f => f.Description == "updt");

            //Delete it
            int result = rating.Delete();

            Assert.IsTrue(result == 1);
        }
Esempio n. 3
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                Rating rating = ratings[ddlRatings.SelectedIndex];

                rating.Delete();

                ratings.Remove(rating);

                Reload();

                ddlRatings_SelectedIndexChanged(sender, e);

                Session["ratings"] = ratings;
            }
            catch (Exception ex)
            {
                Response.Write("Error: " + ex.Message);
            }
        }
 public IActionResult Delete(int id)
 {
     Rating.Delete(id);
     return(RedirectToAction("Index"));
 }