Example #1
0
        public ActionResult salvarIdiomaCadastro(IdiomaCadastroForm ViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("modal-editar", ViewModel));
            }

            bool flagSucesso = OIdiomaCadastroBL.salvar(ViewModel.Idioma);

            return(Json(new { error = !flagSucesso, message = (flagSucesso ? "" : "Não foi possível salvar o registro.") }));
        }
Example #2
0
        public ActionResult modalEditar(int?id)
        {
            var ViewModel = new IdiomaCadastroForm();

            if (id > 0)
            {
                ViewModel.carregar(id.toInt());
            }

            return(View(ViewModel));
        }