コード例 #1
0
        public ContentResult DeletePopup(RecipesViewModel model)
        {
            string json = ""; int rez = 0; string message = "";

            // message = "Подумай ще!";
            if (ModelState.IsValid)
            {
                var status = _recipeProvider.DeletePopup(model.Id);
                if (status == StatusDeleteViewModel.Succes)
                {
                    rez = 1;
                }
                else
                {
                    message = "Во время удаления возникла ошибка!";
                    rez     = 2;
                }
            }
            json = JsonConvert.SerializeObject(new
            {
                rez     = rez,
                message = message
            });
            return(Content(json, "application/json"));
        }