Ejemplo n.º 1
0
        public ActionResult Index()
        {
            AgendamentoViewModel agendamentoVM = new AgendamentoViewModel();
            agendamentoVM.HandleRequest();

            return View(agendamentoVM);
        }
Ejemplo n.º 2
0
        public ActionResult Index(AgendamentoViewModel agendamentoVM)
        {
            agendamentoVM.isValid = true; // ModelState.IsValidField("NovoAgendamento");

            agendamentoVM.HandleRequest();

            if (ModelState.IsValid)
            {
                ModelState.Clear();

            }

            if (Request.IsAjaxRequest())
            {
                if (agendamentoVM.IsAgendamentoMode)
                {
                    return PartialView("_NovoAgendamento", agendamentoVM);
                }

                return PartialView("_ListaAgendamentos", agendamentoVM);
            }

            return View(agendamentoVM);
        }