private void buttonAddFornecedor_Click(object sender, EventArgs e)
        {
            FormPessoaCad formCadastroPessoa = new FormPessoaCad(EnumPessoaTipo.Fornecedor, false);

            if (formCadastroPessoa.ShowDialog(this) == DialogResult.Yes)
            {
            }

            formCadastroPessoa.Dispose();
        }
Example #2
0
        private void timerPrincipal_Tick(object sender, EventArgs e)
        {
            toolStripStatusLabelTime.Text = DateTime.Now.ToLongDateString() + " - " + DateTime.Now.ToLongTimeString();
            toolStripStatusLabelTime.Text.ToUpper();

            try
            {
                if (Dns.GetHostAddresses("empresadb.mysql.uhserver.com") != null)
                {
                    IPAddress[] ip = Dns.GetHostAddresses("empresadb.mysql.uhserver.com");
                    ConectedSystem = true;
                }
                else
                {
                    ConectedSystem = false;
                    AbrirFormConexao();
                }
            }
            catch (Exception)
            {
                ConectedSystem = false;
                AbrirFormConexao();
            }

            if (abrirformPessoa)
            {
                abrirformPessoa = false;

                if (Application.OpenForms["FormLogin"] != null)
                {
                    Application.OpenForms["FormLogin"].Dispose();
                }

                FecharForm();
                FormPessoaCad formPessoa = new FormPessoaCad(EnumPessoaTipo.Funcionario, EnumAssistencia.Assistencia);
                if (formPessoa.ShowDialog(this) == DialogResult.Yes)
                {
                    AoCarregar();
                }
                else
                {
                    Application.Exit();
                }
                formPessoa.Dispose();

                //if (Application.OpenForms["FormPessoa"] == null)
                //{

                //}
            }
        }
        private void AbrirCliente()
        {
            if (colecaoPessoa[0].Nome != "NENHUM REGISTRO FOI ENCONTRADO!")
            {
                Selecionado();

                if (this.Modal)
                {
                    DialogResult = DialogResult.Yes;
                }
                else
                {
                    FormPessoaCad formCadastroPessoa = new FormPessoaCad(infoPessoa);
                    formCadastroPessoa.ShowDialog(this);
                    formCadastroPessoa.Dispose();
                }
            }
            else
            {
                FormMessage.ShowMessegeWarning("NENHUM REGISTRO FOI ENCONTRADO!");
            }
        }