initial commit
This commit is contained in:
58
stuff/Cliente/Cadastro_de_Clientes.cs
Normal file
58
stuff/Cliente/Cadastro_de_Clientes.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
using System.Windows.Forms;
|
||||
using CSharpLibrary.SqlTypes;
|
||||
|
||||
namespace ProjetoLPVIII
|
||||
{
|
||||
public partial class Cadastro_de_Clientes : Form
|
||||
{
|
||||
public Cadastro_de_Clientes()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Clean()
|
||||
{
|
||||
txtNome.Clear();
|
||||
txtRg.Clear();
|
||||
txtCpf.Clear();
|
||||
txtTel.Clear();
|
||||
txtCelular.Clear();
|
||||
txtRua.Clear();
|
||||
txtNumero.Clear();
|
||||
txtCidade.Clear();
|
||||
statusLivro.SelectedIndex = 0;
|
||||
}
|
||||
private void btnSalvar_Click(object sender, EventArgs e)
|
||||
{
|
||||
SqlException sql = null;
|
||||
try
|
||||
{
|
||||
Cliente c1 = new Cliente(null,
|
||||
txtNome.Text,
|
||||
txtRg.Text,
|
||||
txtCpf.Text,
|
||||
txtTel.Text,
|
||||
txtCelular.Text,
|
||||
txtRua.Text,
|
||||
txtNumero.Text,
|
||||
txtCidade.Text,
|
||||
statusLivro.SelectedItem.ToString()
|
||||
);
|
||||
c1.Add();
|
||||
}
|
||||
catch (SqlException g)
|
||||
{
|
||||
sql = g;
|
||||
MessageBox.Show("Falha no cadastro!");
|
||||
}
|
||||
if (sql == null)
|
||||
{
|
||||
MessageBox.Show("Cliente Cadastrado!");
|
||||
Clean();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user