Example #1
0
        public ActionResult Salvar(AgendamentoForm model)
        {
            try
            {
                var respository = new MazzaFC.APIContrato.Repository.AgendamentoRepository(this.token);
                if (model.AgendamentoId == null || model.AgendamentoId == Guid.Empty)
                {
                    var retorno = respository.Adicionar(model);
                    if (retorno.Erro)
                    {
                        throw new Exception(retorno.Mensagem);
                    }

                    return(Json(retorno.ObjRetorno, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    var retorno = respository.Editar(model);
                    if (retorno.Erro)
                    {
                        throw new Exception(retorno.Mensagem);
                    }

                    return(Json(retorno.ObjRetorno, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, ex.Message));
            }
        }
        public async Task Agendamento(IDialogContext context, LuisResult result)
        {
            await context.PostAsync("Ok, vamos lá...");

            var form = new AgendamentoForm();

            //Build AgendamentoForm
            var agendamentoFormDialog = new FormDialog <AgendamentoForm>(form, this.BuildAgendamentoForm, FormOptions.PromptInStart, result.Entities);

            //Show Result
            context.Call(agendamentoFormDialog, this.ShowResult);
        }
Example #3
0
        public async Task Agendamento(IDialogContext context, LuisResult result)
        {
            GetEntityRecommendation("TipoAgendamento", "TipoAgendamento", result);
            GetEntityRecommendation("builtin.datetime.date", "Data", result);

            await context.PostAsync("Ok, vamos lá...");

            var form             = new AgendamentoForm();
            var hotelsFormDialog = new FormDialog <AgendamentoForm>(form, this.BuildHairForm, FormOptions.PromptInStart, result.Entities);

            context.Call(hotelsFormDialog, this.ResumeAfterHairFormDialog);
        }