Ejemplo n.º 1
0
        private void SaveQuery()
        {
            QueryExpression model = queryVM.Model as QueryExpression;

            SerializationService serializer = new SerializationService();
            string json = serializer.ToJson(model);

            try
            {
                HermesService Hermes  = new HermesService();
                Request       request = Hermes.GetTestRequest();
                request.ParseTree = json;
                request.Save();

                Z.Notify(new Notification()
                {
                    Title = CONST_ModuleDialogsTitle, Content = "The query has been saved."
                });
            }
            catch (Exception ex)
            {
                Z.Notify(new Notification()
                {
                    Title = CONST_ModuleDialogsTitle, Content = Z.GetErrorText(ex)
                });
            }
        }
Ejemplo n.º 2
0
        private void ShowJSON()
        {
            QueryExpression model = this.Model as QueryExpression;

            if (model == null)
            {
                return;
            }

            SerializationService service = new SerializationService();

            this.JSONText          = service.ToJson(model);
            this.IsJSONTabSelected = true;
        }
Ejemplo n.º 3
0
        private void SaveQuery()
        {
            QueryExpression model = this.Model as QueryExpression;

            if (model == null)
            {
                return;
            }

            if (model.Request == null)
            {
                Z.Notify(new Notification()
                {
                    Title = CONST_ModuleDialogsTitle, Content = "Объект запроса не указан."
                });
                return;
            }

            try
            {
                SerializationService serializer = new SerializationService();
                model.Request.ParseTree = serializer.ToJson(model);
                model.Request.Save();

                Z.Notify(new Notification()
                {
                    Title = CONST_ModuleDialogsTitle, Content = "Объект запроса сохранён успешно."
                });
            }
            catch (Exception ex)
            {
                Z.Notify(new Notification()
                {
                    Title = CONST_ModuleDialogsTitle, Content = Z.GetErrorText(ex)
                });
            }
        }