コード例 #1
0
        private void btn_Voltar_Click(object sender, EventArgs e)
        {
            Form_Adimin f = new Form_Adimin();

            f.Show();
            this.Visible = false;
        }
コード例 #2
0
        private void btn_Salvar_Click(object sender, EventArgs e)
        {
            try
            {
                string IDS = "update Funcionarios set Nome=@Nome,Senha=@sen where ID_F=" + ID;
                Con.cm1 = new OleDbCommand(IDS, Con.c1);

                tabela.Clear();
                Con.cm1.Parameters.Add("@Nome", OleDbType.VarChar).Value = txt_Nome_edit.Text;
                Con.cm1.Parameters.Add("@sen", OleDbType.VarChar).Value  = txt_edit.Text;


                Con.c1.Open();
                Con.cm1.ExecuteNonQuery();
                add();
                Con.c1.Close();

                Form_Adimin f = new Form_Adimin();
                f.Show();
                Visible = false;
            }
            catch (Exception erro)
            {
                MessageBox.Show(erro.Message);
            }
        }
コード例 #3
0
 private void Logad()
 {
     try
     {
         string select;
         c.adp1.SelectCommand = new OleDbCommand(select = ("SELECT * FROM Admin"), c.c1);
         c.adp1.Fill(Logiad);
         if (Logiad.Rows[0][1].ToString() == txt_nome.Text && Logiad.Rows[0][2].ToString() == txt_senha.Text)
         {
             Form_Adimin f = new Form_Adimin();
             f.Show();
             this.Visible = false;
         }
         else
         {
             MessageBox.Show("Dados não são compactiveis");
         }
     }
     catch
     {
         MessageBox.Show("Administrador não existente!");
     }
 }