Example #1
0
        public async Task <ActionResult> Delete(int id, FormCollection collection)
        {
            try
            {
                if (Session["roleId"] == null)
                {
                    return(RedirectToAction("Index", "Home"));
                }
                if (Session["roleId"].ToString() != "1")
                {
                    return(RedirectToAction("Index", "Home"));
                }

                await _proxy.DeleteRestaurantAsync(id);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError));
            }
        }