Exemplo n.º 1
0
        private void salvar()
        {
            if (txtAPI_01.Text != "")
            {
                if (config == null)
                {
                    config = new ClsConfigGeral();
                }
                config.Chave_Api    = txtAPI_01.Text.ToString().Trim();
                config.Chave_Api_02 = txtAPI_02.Text.ToString().Trim();
                config.Chave_Api_03 = txtAPI_03.Text.ToString().Trim();

                if (config.dataCadastro == null)
                {
                    config.dataCadastro = DateTime.Now;
                }

                config.dataAlteracao = DateTime.Now;

                Models.XML_Cadastro gerarCadastro = new Models.XML_Cadastro();
                gerarCadastro.GerarXMLCadastro_MonitoramentoAcao(config);

                MessageBox.Show("Configuração salva com sucesso!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Question);

                this.Close();
            }
            else
            {
                if (txtAPI_01.Text != "")
                {
                    MessageBox.Show("O campo para Chave API 01 não pode ficar vazio, verifique!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Question);
                    txtAPI_01.Focus();
                }
            }
        }
Exemplo n.º 2
0
        private void carregarConfig()
        {
            Models.XML_Cadastro carregar = new Models.XML_Cadastro();
            config = carregar.CarregarCadastrosMonitoramentoAcoes();

            txtAPI_01.Text = config.Chave_Api;
            txtAPI_02.Text = config.Chave_Api_02;
            txtAPI_03.Text = config.Chave_Api_03;
        }
Exemplo n.º 3
0
        private void carregarCadastro()
        {
            //Carregar XML
            try
            {
                Models.XML_Cadastro carregar = new Models.XML_Cadastro();
                config = carregar.CarregarCadastrosMonitoramentoAcoes();

                if (config != null)
                {
                    this.CarregarGridCadastroArquivo();
                }
            }
            catch (Exception ex)
            {
                this.gerarLogErro(ex.Message + " - Erro ao Carregar Cadastro_MonitoramentoAcoes.XML");
            }
        }
 private void salvarCadastro()
 {
     //Salvar Cadastro na XML
     Models.XML_Cadastro gerarCadastro = new Models.XML_Cadastro();
     gerarCadastro.GerarXMLCadastro_MonitoramentoAcao(config);
 }