Пример #1
0
        private void GetDados()
        {
            crudPtServer crud = new crudPtServer("");

            gridListaLog.DataSource = crud.GetListaLogs();
            //gridListaLog.DataBindingComplete();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            crudPtServer crud = new crudPtServer(utilConexao.tcm.UrlWS);

            //Selecionar as combos
            //if (cbEmpresa.SelectedIndex < 0)
            //{
            //    MessageBox.Show("Favor selecionar uma empresa para continuar", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    return;
            //}
            //if (cbSetor.SelectedIndex < 0)
            //{
            //    MessageBox.Show("Favor selecionar um setor para continuar", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    return;
            //}

            try
            {
                crud.InsertEmpresaSetor(cbEmpresa.SelectedValue.ToString(), cbEmpresa.Text, cbSetor.SelectedValue.ToString(), cbSetor.Text);
                //MessageBox.Show("A aplicação será reiniciada!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //Apagar o banco local antes de reinicar.
                crud.DeleteUsuario();
                this.Close();
            }
            catch (Exception ex)
            {
                ex.ToString();
                MessageBox.Show("Houve falha ao tentar salvar arquivo de configuração. Verifique os filtros adicionados.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void GetUsuarios()
        {
            crud = new crudPtServer(utilConexao.tcm.UrlWS);
            ds   = new DataSetpnrClient();
            crud.GetUsuarioTemplate(ds);

            cbNomes.DisplayMember = "DSUsuario";
            cbNomes.ValueMember   = "IDVinculoUsuario";
            cbNomes.DataSource    = ds.TBUsuarioLocal;
            cbNomes.Update();
        }
Пример #4
0
        public static string CriarHash(string hash)
        {
            crudPtServer crud   = new crudPtServer("");
            var          config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            if (string.IsNullOrEmpty(hash))
            {
                hash = Guid.NewGuid().ToString();
                crud.AtualizaScriptBanco();
                hash = crud.GetTBLocalHash(hash);
            }
            config.AppSettings.Settings["hash"].Value = hash;
            config.Save(ConfigurationSaveMode.Modified);

            ConfigurationManager.RefreshSection("appSettings");
            return(config.AppSettings.Settings["hash"].ToString());
        }
Пример #5
0
        public static string GetHash(string Url)
        {
            crudPtServer crud = new crudPtServer(Url);
            string       hash = ConfigurationManager.AppSettings["hash"].ToString();

            if (string.IsNullOrEmpty(hash))
            {
                try
                {
                    hash = crud.GetTBBancoLocalHash();
                }
                catch { }
            }
            crud.AtualizaScriptBanco();
            crud.LimpaTabelaHash();
            return(hash);
        }