Ejemplo n.º 1
0
        public FrmModCad()
        {
            InitializeComponent();

            i = new Formularios();
            i.Novo(new Button[] { btnInserir, btnProcurar, btnEditar, btnExcluir, btnCancelar });
        }
Ejemplo n.º 2
0
 private void FrmConsUnMedida_Load(object sender, EventArgs e)
 {
     f = new Formularios();
     f.AlterarCor(GridDados);
     f.Localizar(GridDados, cBoxTipoPesquisa, tBoxConsUMed);
     cBoxTipoPesquisa.SelectedIndex = 0;
     SORT();
 }
Ejemplo n.º 3
0
        //***************Cadastro de Categoria*************
        private void btnCategoria_Click(object sender, EventArgs e)
        {
            f = new Formularios();
            FrmCadCategoria frm = new FrmCadCategoria();

            if (f.VerificaDisponibilidade(frm.Name, this) == true)
            {
                frm.MdiParent = this;
                frm.Show();
            }
        }
Ejemplo n.º 4
0
        //***************Cadastro de Usuário*************
        private void btnUsuario_Click(object sender, EventArgs e)
        {
            f = new Formularios();
            frmCadUsuario frm = new frmCadUsuario();

            if (f.VerificaDisponibilidade(frm.Name, this) == true)
            {
                frm.MdiParent = this;
                frm.Show();
            }
        }
Ejemplo n.º 5
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            i = new Formularios();
            FrmConsUnMedida f = new FrmConsUnMedida();

            if (i.VerificaDisponibilidade(f.Name, FrmMain.ActiveForm))
            {
                f.MdiParent = FrmMain.ActiveForm;
                f.Show();
            }
        }
Ejemplo n.º 6
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            Formularios frm = new Formularios();
            Thread      th;


            pBoxLoading.Visible = true;
            ModUsuario md = new ModUsuario();

            md.Login = tBoxLogin.Text;
            md.Senha = tBoxSenha.Text;

            DALConexao cn  = new DALConexao(DAL.DALDadosConexao.ConStr);
            BLLUsuario bll = new BLLUsuario(cn);

            try
            {
                string msg, desc;
                if (!bll.ValidarUsuaio(md).Contains("não"))
                {
                    Properties.Settings.Default.user = md.Login;
                    Properties.Settings.Default.Save();
                    MessageBox.Show(md.Login + " conectado com sucesso !", "Bem Vindo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Application.ExitThread();

                    th = new Thread(TelaMain);

                    th.SetApartmentState(ApartmentState.STA);
                    th.Start();
                    msg  = md.Login;
                    desc = "LOGADO COM SUCESSO";
                    frm.NovoLogLogin(msg, desc);
                    Application.ExitThread();
                }
                else
                {
                    MessageBox.Show("Falha ao conectar. Verifique seu Login e Senha !", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    tBoxLogin.Focus();
                    msg  = md.Login;
                    desc = "LOGIN FALHOU";
                    frm.NovoLogLogin(msg, desc);
                    pBoxLoading.Visible = false;
                }
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error);
                frm.NovoLogErro(ex.Message, ex.InnerException.ToString());
                pBoxLoading.Visible = false;
            }
        }
Ejemplo n.º 7
0
 private void FrmCadCategoria_Enter(object sender, EventArgs e)
 {
     if (Properties.Settings.Default.editar == true)
     {
         i = new Formularios();
         tBoxCategoria.Text = Properties.Settings.Default.categoria;
         i.Alterar(new Button[] { btnInserir, btnProcurar, btnEditar, btnExcluir, btnCancelar });
         Properties.Settings.Default.editar = false;
         Properties.Settings.Default.Save();
         tsCadStatus.Image   = null;
         tsCadStatus.Text    = "";
         tsCadProgress.Value = 0;
     }
 }
Ejemplo n.º 8
0
        private void btnCancelar_MouseHover(object sender, EventArgs e)
        {
            Formularios f = new Formularios();

            f.Balao(BalaoInfo, btnCancelar.Name.Substring(3), btnCancelar);
        }