Professional Documents
Culture Documents
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TrabalhoILP20
{
}
}
}
Alterar Alimentos
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TrabalhoILP20
{
public partial class Alterar_Alimentos : Form
{
private SqlConnection conexao;
private SqlCommand comando;
private SqlDataAdapter adapter;
private DataTable tblalimentos;
private string strsql, strconex;
public Alterar_Alimentos()
{
InitializeComponent();
}
adapter.Fill(tblalimentos);
if (tblalimentos.Rows.Count == 1)
{
grupo1.Enabled = false;
grupo2.Visible = true;
txtalimento.Text = tblalimentos.Rows[0]["alimento"].ToString();
txtdescricao.Text = tblalimentos.Rows[0]["descricao"].ToString();
else
{
MessageBox.Show("Registro não encontrado!", "mensagem",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TrabalhoILP20
{
public partial class Consultar_Animais_Pais : Form
{
public Consultar_Animais_Pais()
{
InitializeComponent();
}
Menu
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TrabalhoILP20
{
public partial class Menu : Form
{
public int Nivel;
public string Nome;
public Menu()
{
InitializeComponent();
}
}
private void CadastroToolStripMenuItem_Click(object sender, EventArgs e)
{
Cadastro_Animais cadanimais = new Cadastro_Animais();
cadanimais.Show();
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TrabalhoILP20
{
public partial class Alterar_Animais : Form
{
private SqlConnection conexao;
private SqlCommand comando;
private SqlDataAdapter adapter;
private DataTable tblanimais;
private string strsql, strconex;
public Alterar_Animais()
{
InitializeComponent();
}
adapter.Fill(tblanimais);
if (tblanimais.Rows.Count == 1)
{
groupBox1.Enabled = false;
groupBox2.Visible = true;
txtanimal.Text = tblanimais.Rows[0]["animal"].ToString();
txtpaisorigem.Text = tblanimais.Rows[0]["paisorigem"].ToString();
txtlocalizacao.Text = tblanimais.Rows[0]
["localizacao"].ToString();
txtcodalimento.Text = tblanimais.Rows[0]
["codalimento"].ToString();
else
{
MessageBox.Show("Registro não encontrado!", "mensagem",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}
Cadastro Animais
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TrabalhoILP20
{
public partial class Cadastro_Animais : Form
{
private SqlConnection conexao;
private SqlCommand comando;
private string strsql, strconex;
public Cadastro_Animais()
{
InitializeComponent();
}
Consulta de Alimentos
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TrabalhoILP20
{
public partial class Consulta_Alimentos : Form
{
private SqlConnection conexao;
private SqlDataAdapter adapter;
private DataTable tblalimentos, tblanimais;
private string strsql, strconex;
private int registro = 0;
public Consulta_Alimentos()
{
InitializeComponent();
}
Excluir Animais
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TrabalhoILP20
{
public partial class Excluir_Animais : Form
{
private SqlConnection conexao;
private SqlCommand comando;
private SqlDataAdapter adapter;
private DataTable tblanimais;
private string strsql, strconex;
public Excluir_Animais()
{
InitializeComponent();
}
groupBox1.Enabled = true;
groupBox2.Visible = false;
}
adapter.Fill(tblanimais);
if (tblanimais.Rows.Count == 1)
{
groupBox1.Enabled = false;
groupBox2.Visible = true;
txtanimal.Text = tblanimais.Rows[0]["animal"].ToString();
txtpaisorigem.Text = tblanimais.Rows[0]["paisorigem"].ToString();
txtlocalizacao.Text = tblanimais.Rows[0]
["localizacao"].ToString();
txtcodalimento.Text = tblanimais.Rows[0]
["codalimento"].ToString();
else
{
MessageBox.Show("Registro não encontrado!", "mensagem",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}