public void Inserir(EnderecoPizza end) { SqlCommand c = new SqlCommand(); c.CommandType = System.Data.CommandType.Text; c.CommandText = "insert into EnderecoPizza (numero, bairro, complemento)values (@numero, @bairro, @complemento)"; c.Parameters.AddWithValue("@numero", end.Numero); c.Parameters.AddWithValue("@bairro", end.Bairro); c.Parameters.AddWithValue("@complemento", end.Complemento); ConexaoDAO con = new ConexaoDAO(); con.CRUD(c); }
public void Inserir(Usuario u) { SqlCommand c = new SqlCommand(); c.CommandType = CommandType.Text; c.CommandText = "insert into tbl_usuario (nome, cpf,senha,cep,rua,numero,telefone ) values (@nome,@cpf, @senha,@cep,@rua,@numero,@telefone)"; c.Parameters.AddWithValue("@nome", u.Nome); c.Parameters.AddWithValue("@cpf", u.Cpf); c.Parameters.AddWithValue("@senha", u.Senha); c.Parameters.AddWithValue("@cep", u.Cep); c.Parameters.AddWithValue("@rua", u.Rua); c.Parameters.AddWithValue("@numero", u.Numero); c.Parameters.AddWithValue("@telefone", u.Telefone); ConexaoDAO con = new ConexaoDAO(); con.CRUD(c); }