Beispiel #1
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    Models.Review temp = new Models.Review
                    {
                        Id           = id,
                        Comment      = collection["Comment"],
                        Rating       = double.Parse(collection["Rating"]),
                        RestaurantId = int.Parse(collection["RestaurantId"])
                    };

                    da.UpdateReview(temp);

                    return(RedirectToAction("Details", new { id = temp.RestaurantId }));
                }
                return(View());
            }
            catch
            {
                return(View());
            }
        }