private void pictureBox2_Click(object sender, EventArgs e) { string cpf = maskedTextBox2.Text; DTO_Usuario obj = new DTO_Usuario(); obj = BLL_Cadastro.BuscarUsuario(cpf); textBox33.Text = obj.idUsuario.ToString(); textBox4.Text = obj.Nome; textBox12.Text = obj.UserName; textBox7.Text = obj.Email; maskedTextBox2.Text = obj.CPF; textBox5.Text = obj.RG; maskedTextBox3.Text = obj.DataNascimento; maskedTextBox4.Text = obj.TelFixo; maskedTextBox5.Text = obj.TelCelular; textBox8.Text = obj.Endereco; textBox9.Text = obj.Numero; textBox10.Text = obj.Bairro; textBox11.Text = obj.Cidade; comboBox4.Text = obj.Estado; maskedTextBox1.Text = obj.CEP; comboBox1.Text = obj.Tipo; if (obj.Ativo.ToLower() == "ativo") { radioButton8.Checked = true; } if (obj.Ativo.ToLower() == "inativo") { radioButton9.Checked = true; } if (obj.Sexo.ToLower() == "masculino") { radioButton5.Checked = true; } if (obj.Sexo.ToLower() == "feminino") { radioButton6.Checked = true; } if (obj.Sexo.ToLower() == "outros") { radioButton7.Checked = true; } textBox6.Text = obj.Senha; textBox13.Text = obj.ConfSenha = obj.Senha; }
private void btn_Cad_Click(object sender, EventArgs e) { try { DTO_Cadastro objCad = new DTO_Cadastro(); objCad.nome = name_Cad.Text; objCad.email = email_Cad.Text; objCad.cpf = cpf_Cad.Text; objCad.nick = nick_Cad.Text; objCad.pass = pass_Cad.Text; objCad.cnfPass = confPass_Cad.Text; MessageBox.Show(BLL_Cadastro.ValidCad(objCad)); Limpar(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_cadastro_Click(object sender, EventArgs e) { try { DTO_Cadastro obj = new DTO_Cadastro(); obj.nome = txtNome.Text; obj.userName = txtUsuario.Text; obj.email = txtEmail.Text; obj.CPF = txtCpf.Text; obj.senha = txtSenha.Text; obj.confSenha = txtConfSenha.Text; MessageBox.Show(BLL_Cadastro.ValidarCadastro(obj)); this.Hide(); Home home = new Home(); home.ShowDialog(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void cadastrar_Click(object sender, EventArgs e) { DTO_Usuario obj = new DTO_Usuario(); obj.Nome = Nome.Text; obj.Email = Email.Text; obj.UserName = Nusuario.Text; obj.Senha = Senha.Text; obj.SenhaC = Csenha.Text; obj.CPF = Cpf.Text; BLL_Cadastro.ValidarCadastro(obj); try { MessageBox.Show("Cadastro efetuado com sucesso", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); Form1 login = new Form1(); login.ShowDialog(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button6_Click(object sender, EventArgs e) { try { DTO_Usuario obj = new DTO_Usuario(); obj.idUsuario = int.Parse(textBox33.Text); obj.Nome = textBox4.Text; obj.UserName = textBox12.Text; obj.Email = textBox7.Text; obj.CPF = maskedTextBox2.Text; obj.RG = textBox5.Text; obj.DataNascimento = maskedTextBox3.Text; obj.TelFixo = maskedTextBox4.Text; obj.TelCelular = maskedTextBox5.Text; obj.Endereco = textBox8.Text; obj.Numero = textBox9.Text; obj.Bairro = textBox10.Text; obj.Cidade = textBox11.Text; obj.Estado = comboBox4.Text; obj.CEP = maskedTextBox1.Text; obj.Tipo = comboBox1.Text; if (radioButton8.Checked == true) { obj.Ativo = radioButton8.Text; } if (radioButton9.Checked == true) { obj.Ativo = radioButton9.Text; } if (radioButton5.Checked == true) { obj.Sexo = radioButton5.Text; } if (radioButton6.Checked == true) { obj.Sexo = radioButton6.Text; } if (radioButton7.Checked == true) { obj.Sexo = radioButton7.Text; } obj.Senha = textBox6.Text; obj.ConfSenha = textBox13.Text; obj.AcaoUsuario = "alteracao"; MessageBox.Show(BLL_Cadastro.CadUsuario(obj)); textBox4.Clear(); textBox12.Clear(); textBox7.Clear(); maskedTextBox2.Clear(); textBox5.Clear(); maskedTextBox3.Clear(); maskedTextBox4.Clear(); maskedTextBox5.Clear(); textBox8.Clear(); textBox9.Clear(); textBox10.Clear(); textBox11.Clear(); comboBox1.SelectedIndex = -1; comboBox4.SelectedIndex = -1; maskedTextBox1.Clear(); textBox6.Clear(); textBox13.Clear(); textBox33.Clear(); radioButton5.Checked = false; radioButton6.Checked = false; radioButton7.Checked = false; radioButton8.Checked = false; radioButton9.Checked = false; textBox4.Focus(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Não Cadastrado", MessageBoxButtons.OK, MessageBoxIcon.Error); } }