Exemplo n.º 1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            num         = num - 1;
            label2.Text = Convert.ToString(num);
            if (num == 0)
            {
                timer1.Enabled = false;

                this.Close();

                Form frente = new PDV();
                GerenciadorDeFormulario.Abre(frente);
            }
        }
Exemplo n.º 2
0
        private void pictureBox16_Click(object sender, EventArgs e)
        {
            Ferramentas.Dedo_Duro();
            if (Global.Margem.ExpirouLicença == "sim")
            {
                Application.Exit();
            }
            if (Global.Margem.CaixaTerminalVendas == "adm")
            {
                string linha;
                try
                {
                    using (StreamReader reader = new StreamReader("CaixaAberto.txt"))
                    {
                        linha = reader.ReadLine();
                    }
                }
                catch (Exception)
                {
                    linha = "não";
                }

                if (linha == "não")
                {
                    pictureBox17.Visible = true;
                    Form abre = new AbrirCaixa();
                    abre.ShowDialog();
                    pictureBox17.Visible = false;;
                    if (Global.Margem.SemContaCadastrada == "sim")
                    {
                        Global.Margem.SemContaCadastrada = "";
                        return;
                    }
                    Form frente = new PDV();
                    GerenciadorDeFormulario.Abre(frente);
                    if (Global.Margem.ConfiguraçãoSistemaLOGs == "sim")
                    {
                        Ferramentas.CriaLog("CaixaTerminalVendas", "Acessou Caixa / Terminal de Vendas");
                    }
                }
                if (linha == "sim")
                {
                    string conta;
                    try
                    {
                        using (StreamReader reader = new StreamReader("Conta.txt"))
                        {
                            conta = reader.ReadLine();
                            Global.Margem.ContaAberta = conta;
                        }
                    }
                    catch (Exception)
                    {
                        conta = "";
                    }
                    string valor;
                    try
                    {
                        using (StreamReader reader = new StreamReader("Valor.txt"))
                        {
                            valor = reader.ReadLine();
                            Global.Margem.ValorAberto = valor;
                        }
                    }
                    catch (Exception)
                    {
                        valor = "";
                    }
                    if (String.IsNullOrEmpty(valor) == true || String.IsNullOrEmpty(conta) == true)
                    {
                        using (StreamWriter writer = new StreamWriter("CaixaAberto.txt"))
                        {
                            writer.Write("não");
                            return;
                        }
                    }
                    string empresa;
                    try
                    {
                        using (StreamReader reader = new StreamReader("Empresa.txt"))
                        {
                            empresa = reader.ReadLine();
                            Global.Margem.EmpresaCaixa = empresa;
                        }
                    }
                    catch (Exception)
                    {
                        conta = "";
                    }


                    pictureBox17.Visible = true;
                    Form al = new Alert2();
                    al.ShowDialog();

                    Form frente = new PDV();
                    GerenciadorDeFormulario.Abre(frente);
                    if (Global.Margem.ConfiguraçãoSistemaLOGs == "sim")
                    {
                        Ferramentas.CriaLog("CaixaTerminalVendas", "Acessou Caixa / Terminal de Vendas");
                    }
                    pictureBox17.Visible = false;
                    //carrega conf de caixa aberto
                }

                return;
            }
            if (Global.Margem.CaixaTerminalVendas == "sim")
            {
                string linha;
                try
                {
                    using (StreamReader reader = new StreamReader("CaixaAberto.txt"))
                    {
                        linha = reader.ReadLine();
                    }
                }
                catch (Exception)
                {
                    linha = "não";
                }

                if (linha == "não")
                {
                    pictureBox17.Visible = true;
                    Form abre = new AbrirCaixa();
                    abre.ShowDialog();
                    pictureBox17.Visible = false;
                    if (Global.Margem.SemContaCadastrada == "sim")
                    {
                        Global.Margem.SemContaCadastrada = "";
                        return;
                    }
                    Form frente = new PDV();
                    GerenciadorDeFormulario.Abre(frente);
                    if (Global.Margem.ConfiguraçãoSistemaLOGs == "sim")
                    {
                        Ferramentas.CriaLog("CaixaTerminalVendas", "Acessou Caixa / Terminal de Vendas");
                    }
                }
                if (linha == "sim")
                {
                    string conta;
                    try
                    {
                        using (StreamReader reader = new StreamReader("Conta.txt"))
                        {
                            conta = reader.ReadLine();
                            Global.Margem.ContaAberta = conta;
                        }
                    }
                    catch (Exception)
                    {
                        conta = "";
                    }
                    string valor;
                    try
                    {
                        using (StreamReader reader = new StreamReader("Valor.txt"))
                        {
                            valor = reader.ReadLine();
                            Global.Margem.ValorAberto = valor;
                        }
                    }
                    catch (Exception)
                    {
                        valor = "";
                    }
                    if (String.IsNullOrEmpty(valor) == true || String.IsNullOrEmpty(conta) == true)
                    {
                        using (StreamWriter writer = new StreamWriter("CaixaAberto.txt"))
                        {
                            writer.Write("não");
                            return;
                        }
                    }
                    MessageBox.Show("[ Este Caixa não foi Finalizado / Fechado e será reaberto. ]");
                    Form frente = new PDV();
                    GerenciadorDeFormulario.Abre(frente);
                    if (Global.Margem.ConfiguraçãoSistemaLOGs == "sim")
                    {
                        Ferramentas.CriaLog("CaixaTerminalVendas", "Acessou Caixa / Terminal de Vendas");
                    }
                    //carrega conf de caixa aberto
                }

                return;
            }
            if (Global.Margem.CaixaTerminalVendas == "não")
            {
                MessageBox.Show("Acesso não autorizado");
            }
        }