예제 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txtSenha.Text == TxtSenhaConf.Text)
     {
         Cria_Login();
         telacadastro.Atualiza_Lista();
     }
     else
     {
         MessageBox.Show("As senhas não colidem");
     }
 }
예제 #2
0
        public void Edita_login()
        {
            int           cCargo = ((int)CbxCargo.SelectedValue);
            SqlConnection con    = new SqlConnection(WindowsFormsApp5.Properties.Settings.Default.DuckDuckConnectionString);
            SqlCommand    cmd    = new SqlCommand("s_edita_Login", con);

            cmd.Parameters.AddWithValue("@codigo", codigo);
            cmd.Parameters.AddWithValue("@login", TxtLogin.Text);
            cmd.Parameters.AddWithValue("@nome", TxtNome.Text);
            cmd.Parameters.AddWithValue("@email", TxtEmail.Text);
            cmd.Parameters.AddWithValue("@senha", TxtSenha.Text);
            cmd.Parameters.AddWithValue("@cCargo", cCargo);
            cmd.CommandType = CommandType.StoredProcedure;
            con.Open();
            try
            {
                int i = cmd.ExecuteNonQuery();
                MessageBox.Show("Cadastro editado com sucesso");
                telacadastro.Atualiza_Lista();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
            }
        }