Example #1
0
        public IActionResult Form()
        {
            if (ModelState.IsValid)
            {
                if (Classified.Id == 0)
                {
                    //CREATE
                    _classifiedService.Add(Classified, "add");;
                }
                else
                {
                    _classifiedService.Add(Classified, "update");
                }


                return(Json(new { isValid = true, html = Helper.RenderRazorViewToString(this, "_ViewAll", _classifiedService.GetAll()) }));
            }

            return(Json(new { isValid = false, html = Helper.RenderRazorViewToString(this, "Form", Classified) }));
        }