private void button5_Click(object sender, EventArgs e) { DataTable cor = DALCadastro.CoresRetorna(Global.Margem.Operador); if (cor.Rows.Count <= 0) { int cor1 = Convert.ToInt32(pictureBox1.BackColor.ToArgb()); int cor2 = Convert.ToInt32(pictureBox2.BackColor.ToArgb()); int cor3 = Convert.ToInt32(pictureBox3.BackColor.ToArgb()); int cor4 = Convert.ToInt32(pictureBox4.BackColor.ToArgb()); int cor5 = Convert.ToInt32(pictureBox8.BackColor.ToArgb()); DALCadastro.OperadorCoresInsere(Global.Margem.Operador, Convert.ToString(cor1), Convert.ToString(cor2), Convert.ToString(cor3), Convert.ToString(cor4), Convert.ToString(cor5)); MessageBox.Show("Aparência alterada com sucesso!"); } if (cor.Rows.Count > 0) { int cor1 = Convert.ToInt32(pictureBox1.BackColor.ToArgb()); int cor2 = Convert.ToInt32(pictureBox2.BackColor.ToArgb()); int cor3 = Convert.ToInt32(pictureBox3.BackColor.ToArgb()); int cor4 = Convert.ToInt32(pictureBox4.BackColor.ToArgb()); int cor5 = Convert.ToInt32(pictureBox8.BackColor.ToArgb()); DALCadastro.OperadorCores(Global.Margem.Operador, Convert.ToString(cor1), Convert.ToString(cor2), Convert.ToString(cor3), Convert.ToString(cor4), Convert.ToString(cor5)); MessageBox.Show("Aparência alterada com sucesso!"); } }
private void UsuariosSistema_Load(object sender, EventArgs e) { DataTable cor = DALCadastro.CoresRetorna(Global.Margem.Operador); this.Text += " ==> Operador: " + Global.Margem.Operador; DataTable cor10 = DALCadastro.CoresRetorna(Global.Margem.Operador); if (cor10.Rows.Count > 0) { panel1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["CorMenu"].ToString())); panel2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor2"].ToString())); } else { DataTable cor2 = DALCadastro.CoresRetorna("Default"); if (cor2.Rows.Count > 0) { panel1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["CorMenu"].ToString())); panel2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor2"].ToString())); } } dataGridView1.DataSource = DALCadastro.ListaUsrSistemaEdita(); textBox1.Focus(); }
private void button6_Click(object sender, EventArgs e) { string def = "Default"; DataTable cor = DALCadastro.CoresRetorna(def); if (cor.Rows.Count > 0) { panel2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["CorMenu"].ToString())); pictureBox1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["CorMenu"].ToString())); panel3.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor2"].ToString())); pictureBox2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor2"].ToString())); tabPage1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor3"].ToString())); tabPage2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor3"].ToString())); pictureBox3.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor3"].ToString())); panel4.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor4"].ToString())); pictureBox4.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor4"].ToString())); panel6.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor5"].ToString())); pictureBox8.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor5"].ToString())); MessageBox.Show("Aparência original restaurada"); return; } if (cor.Rows.Count <= 0) { int cor1 = Convert.ToInt32(pictureBox1.BackColor.ToArgb()); int cor2 = Convert.ToInt32(pictureBox2.BackColor.ToArgb()); int cor3 = Convert.ToInt32(pictureBox3.BackColor.ToArgb()); int cor4 = Convert.ToInt32(pictureBox4.BackColor.ToArgb()); int cor5 = Convert.ToInt32(pictureBox8.BackColor.ToArgb()); DALCadastro.OperadorCoresInsere(def, Convert.ToString(cor1), Convert.ToString(cor2), Convert.ToString(cor3), Convert.ToString(cor4), Convert.ToString(cor5)); MessageBox.Show("Aparência original restaurada"); } }
private void pictureBox3_Click(object sender, EventArgs e) { Form formPrincipal = new TelaPrincipal(); DataTable cor = DALCadastro.CoresRetorna(Global.Margem.Operador); GerenciadorDeFormulario.Abre(formPrincipal); GerenciadorDeFormulario.Fecha(this); }
private void CadastroParticipantes_Load(object sender, EventArgs e) { this.Text = "[Cadastro de Participantes. Operador ==> " + Global.Margem.Operador + "]"; DataTable cor10 = DALCadastro.CoresRetorna(Global.Margem.Operador.ToString()); if (cor10.Rows.Count > 0) { panel9.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["CorMenu"].ToString())); panel2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["Cor2"].ToString())); tabPage3.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["Cor3"].ToString())); panel4.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["Cor4"].ToString())); } }
private void pictureBox13_Click(object sender, EventArgs e) { pictureBox17.Visible = true; Form login = new Login(); login.ShowDialog(); GerenciadorDeFormulario.Fecha(login); pictureBox17.Visible = false; DataTable cor = DALCadastro.CoresRetorna(Global.Margem.Operador); if (cor.Rows.Count > 0) { panel1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor5"].ToString())); } }
private void CadCores_Load(object sender, EventArgs e) { DataTable corDefault = DALCadastro.CoresRetorna("Default"); if (corDefault.Rows.Count <= 0) { int cor11 = Convert.ToInt32(pictureBox1.BackColor.ToArgb()); int cor21 = Convert.ToInt32(pictureBox2.BackColor.ToArgb()); int cor31 = Convert.ToInt32(pictureBox3.BackColor.ToArgb()); int cor41 = Convert.ToInt32(pictureBox4.BackColor.ToArgb()); int cor51 = Convert.ToInt32(pictureBox8.BackColor.ToArgb()); DALCadastro.OperadorCoresInsere("Default", Convert.ToString(cor11), Convert.ToString(cor21), Convert.ToString(cor31), Convert.ToString(cor41), Convert.ToString(cor51)); } textBox2.Text = Global.Margem.Operador; DataTable cor = DALCadastro.CoresRetorna(Global.Margem.Operador); if (cor.Rows.Count > 0) { panel2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["CorMenu"].ToString())); pictureBox1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["CorMenu"].ToString())); panel3.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor2"].ToString())); pictureBox2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor2"].ToString())); tabPage1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor3"].ToString())); tabPage2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor3"].ToString())); pictureBox3.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor3"].ToString())); panel4.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor4"].ToString())); pictureBox4.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor4"].ToString())); panel6.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor5"].ToString())); pictureBox8.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor5"].ToString())); } if (cor.Rows.Count <= 0) { int cor1 = Convert.ToInt32(pictureBox1.BackColor.ToArgb()); int cor2 = Convert.ToInt32(pictureBox2.BackColor.ToArgb()); int cor3 = Convert.ToInt32(pictureBox3.BackColor.ToArgb()); int cor4 = Convert.ToInt32(pictureBox4.BackColor.ToArgb()); int cor5 = Convert.ToInt32(pictureBox8.BackColor.ToArgb()); DALCadastro.OperadorCoresInsere(Global.Margem.Operador, Convert.ToString(cor1), Convert.ToString(cor2), Convert.ToString(cor3), Convert.ToString(cor4), Convert.ToString(cor5)); } }
private void pictureBox18_Click_1(object sender, EventArgs e) { pictureBox17.Visible = true; Form cores = new CadCores(); cores.ShowDialog(); pictureBox17.Visible = false; DataTable cor10 = DALCadastro.CoresRetorna(Global.Margem.Operador); if (cor10.Rows.Count > 0) { panel1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["Cor5"].ToString())); } else { DataTable cor2 = DALCadastro.CoresRetorna("Default"); if (cor2.Rows.Count > 0) { panel1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor2.Rows[0]["Cor5"].ToString())); } } }
private void MovimentoCaixa_Load(object sender, EventArgs e) { DataTable cor = DALCadastro.CoresRetorna(Global.Margem.Operador); this.Text += " ==> Operador: " + Global.Margem.Operador; if (cor.Rows.Count > 0) { DataTable cor10 = DALCadastro.CoresRetorna(Global.Margem.Operador); if (cor10.Rows.Count > 0) { panel1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["CorMenu"].ToString())); panel2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor2"].ToString())); } else { DataTable cor2 = DALCadastro.CoresRetorna("Default"); if (cor2.Rows.Count > 0) { panel1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["CorMenu"].ToString())); panel2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor2"].ToString())); } } } }
private void TelaPrincipal_Load(object sender, EventArgs e) { string impressora; try { using (StreamReader reader = new StreamReader("Impressora.txt")) { impressora = reader.ReadLine(); Global.Margem.Impressora = impressora; } } catch (Exception) { impressora = ""; } if (String.IsNullOrEmpty(impressora) == true) { using (StreamWriter writer = new StreamWriter("Impressora.txt")) { writer.Write("generic"); Global.Margem.Impressora = "generic"; } } string impressao; try { using (StreamReader reader = new StreamReader("SI.txt")) { impressao = reader.ReadLine(); Global.Margem.ServidorImpressao = impressao; } } catch (Exception) { impressao = ""; } if (String.IsNullOrEmpty(impressao) == true) { using (StreamWriter writer = new StreamWriter("SI.txt")) { writer.Write("não"); Global.Margem.ServidorImpressao = "não"; } } if (Global.Margem.ServidorImpressao == "sim") { Form impres = new ServidorImpressao(); impres.Show(); } string linha; try { using (StreamReader reader = new StreamReader("BD.txt")) { linha = reader.ReadLine(); } } catch (Exception) { linha = "local"; } if (linha == "local") { Global.Margem.ConfiguraçãoSistemaBancoDados = "local"; } if (linha == "rede") { Global.Margem.ConfiguraçãoSistemaBancoDados = "rede"; using (StreamReader reader = new StreamReader("BDIp.txt")) { Global.Margem.ConfiguraçãoSistemaBancoDadosIp = reader.ReadLine(); } using (StreamReader reader = new StreamReader("BDPorta.txt")) { Global.Margem.ConfiguraçãoSistemaBancoDadosPorta = reader.ReadLine(); } } string log; try { using (StreamReader reader = new StreamReader("LOG.txt")) { log = reader.ReadLine(); } } catch (Exception) { log = "sim"; } if (log == "sim") { Global.Margem.ConfiguraçãoSistemaLOGs = "sim"; } if (log == "não") { Global.Margem.ConfiguraçãoSistemaLOGs = "não"; } pictureBox17.Visible = true; Form login = new Login(); login.ShowDialog(); GerenciadorDeFormulario.Fecha(login); pictureBox17.Visible = false; DataTable cor = DALCadastro.CoresRetorna(Global.Margem.Operador); if (cor.Rows.Count > 0) { panel1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor.Rows[0]["Cor5"].ToString())); } DataTable inicio = DALCadastro.TestaConfiVazia("1"); if (inicio.Rows.Count > 0) { Global.Margem.ConfiguraçãoSistemaFinanceiroMargem = inicio.Rows[0]["Campo1"].ToString(); Global.Margem.ConfiguraçãoSistemaFinanceiroImpostos = inicio.Rows[0]["Campo2"].ToString(); Global.Margem.ConfiguraçãoSistemaFinanceiroComissão = inicio.Rows[0]["Campo3"].ToString(); } inicio.Clear(); inicio = DALCadastro.TestaConfiVazia("2"); if (inicio.Rows.Count > 0) { Global.Margem.ConfiguraçãoSistemaEstoque = inicio.Rows[0]["Campo1"].ToString(); } inicio.Clear(); inicio = DALCadastro.TestaConfiVazia("3"); if (inicio.Rows.Count > 0) { Global.Margem.ConfiguraçãoSistemaLOGs = inicio.Rows[0]["Campo1"].ToString(); } inicio.Clear(); inicio = DALCadastro.TestaConfiVazia("4"); if (inicio.Rows.Count > 0) { Global.Margem.ConfiguraçãoSistemaCaixaTerminalVendas = inicio.Rows[0]["Campo1"].ToString(); } Ferramentas.CriaLog("Login", "Fez Login no Sistema"); //listar avisos string dia = DateTime.Now.Day.ToString(); if (dia.Length == 1) { dia = "0" + dia; } string mes = DateTime.Now.Month.ToString(); if (mes.Length == 1) { mes = "0" + mes; } string ano = DateTime.Now.Year.ToString(); int compara = Convert.ToInt32(ano + mes + dia); DataTable list = DALCadastro.ListaEventos(); if (list.Rows.Count > 0) { for (int i = 0; i < list.Rows.Count; i++) { int temp = Convert.ToInt32(list.Rows[i]["DataGatilho"].ToString()); if (temp <= compara) { pictureBox17.Visible = true; Form al = new Alert(); al.ShowDialog(); if (Global.Margem.AbreAviso == "sim") { Form av = new Avisos(); av.ShowDialog(); } else { pictureBox17.Visible = false; } if (Global.Margem.AbreAviso == "ok") { pictureBox17.Visible = false; } else { pictureBox17.Visible = false; } Global.Margem.AbreAviso = ""; return; } } } }
private void Config_Load(object sender, EventArgs e) { this.Text += " Operador ==> " + Global.Margem.Operador; if (Global.Margem.ServidorImpressao == "sim") { checkBox10.Checked = true; } dataGridView3.DataSource = DALCadastro.AUXCadListar("ListarCadEmpresa"); DataTable cor10 = DALCadastro.CoresRetorna(Global.Margem.Operador.ToString()); if (cor10.Rows.Count > 0) { panel1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["CorMenu"].ToString())); panel2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["Cor2"].ToString())); tabPage3.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["Cor3"].ToString())); tabPage1.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["Cor3"].ToString())); tabPage2.BackColor = System.Drawing.Color.FromArgb(Convert.ToInt32(cor10.Rows[0]["Cor3"].ToString())); } DataTable inicio = DALCadastro.TestaConfiVazia("1"); if (inicio.Rows.Count > 0) { textBox9.Text = inicio.Rows[0]["Campo1"].ToString(); textBox10.Text = inicio.Rows[0]["Campo2"].ToString(); textBox11.Text = inicio.Rows[0]["Campo3"].ToString(); } inicio.Clear(); inicio = DALCadastro.TestaConfiVazia("2"); if (inicio.Rows.Count > 0) { string teste = inicio.Rows[0]["Campo1"].ToString(); if (teste == "sim") { checkBox3.Checked = true; } if (teste == "não") { checkBox3.Checked = false; } } inicio.Clear(); inicio = DALCadastro.TestaConfiVazia("3"); if (inicio.Rows.Count > 0) { string teste = inicio.Rows[0]["Campo1"].ToString(); if (teste == "sim") { checkBox6.Checked = true; } if (teste == "não") { checkBox6.Checked = false; } } inicio.Clear(); inicio = DALCadastro.TestaConfiVazia("4"); if (inicio.Rows.Count > 0) { string teste = inicio.Rows[0]["Campo1"].ToString(); if (teste == "sim") { checkBox4.Checked = true; } if (teste == "tv") { checkBox4.Checked = false; checkBox7.Checked = true; checkBox7.Visible = true; } if (teste == "caixa") { checkBox4.Checked = false; checkBox9.Checked = true; checkBox9.Visible = true; } } if (Global.Margem.ConfiguraçãoSistemaBancoDados == "local") { checkBox8.Checked = true; } if (Global.Margem.ConfiguraçãoSistemaBancoDados == "rede") { checkBox8.Checked = false; textBox12.Text = Global.Margem.ConfiguraçãoSistemaBancoDadosIp; textBox13.Text = Global.Margem.ConfiguraçãoSistemaBancoDadosPorta; } if (Global.Margem.Impressora == "generic") { checkBox11.Checked = true; } if (Global.Margem.Impressora == "mp4200th") { checkBox12.Checked = true; } }