예제 #1
0
        public ActionResult editar(int?id)
        {
            var ViewModel = new PlanoForm();

            ViewModel.Plano = this.OPlanoBL.carregar(UtilNumber.toInt32(id)) ?? new Plano();

            return(View(ViewModel));
        }
예제 #2
0
        public ActionResult editar(PlanoForm ViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(ViewModel));
            }

            bool flagSucesso = this.OPlanoBL.salvar(ViewModel.Plano);

            if (flagSucesso)
            {
                this.Flash(UtilMessage.TYPE_MESSAGE_SUCCESS, "Os dados do plano foram salvos com sucesso.");
                return(View(ViewModel));
            }

            this.Flash(UtilMessage.TYPE_MESSAGE_ERROR, "Houve um problema ao salvar o registro. Tente novamente.");
            return(View(ViewModel));
        }