initial commit
This commit is contained in:
253
stuff/Item/AlterarEmprestimo.Designer.cs
generated
Normal file
253
stuff/Item/AlterarEmprestimo.Designer.cs
generated
Normal file
@@ -0,0 +1,253 @@
|
||||
namespace CSharpLibrary.stuff.Item
|
||||
{
|
||||
partial class AlterarEmprestimo
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.psqItem = new System.Windows.Forms.Button();
|
||||
this.psqCli = new System.Windows.Forms.Button();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.txtNomeFuncionario = new System.Windows.Forms.TextBox();
|
||||
this.btnSalvar = new System.Windows.Forms.Button();
|
||||
this.btnLimpar = new System.Windows.Forms.Button();
|
||||
this.txtNomeItem = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.txtNomeCliente = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.btnAlterar = new System.Windows.Forms.Button();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dateTimePicker2
|
||||
//
|
||||
this.dateTimePicker2.Location = new System.Drawing.Point(155, 147);
|
||||
this.dateTimePicker2.Name = "dateTimePicker2";
|
||||
this.dateTimePicker2.Size = new System.Drawing.Size(262, 20);
|
||||
this.dateTimePicker2.TabIndex = 78;
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(155, 119);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(262, 20);
|
||||
this.dateTimePicker1.TabIndex = 77;
|
||||
//
|
||||
// psqItem
|
||||
//
|
||||
this.psqItem.Enabled = false;
|
||||
this.psqItem.Location = new System.Drawing.Point(440, 81);
|
||||
this.psqItem.Name = "psqItem";
|
||||
this.psqItem.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqItem.TabIndex = 76;
|
||||
this.psqItem.Text = "Pesquisar";
|
||||
this.psqItem.UseVisualStyleBackColor = true;
|
||||
this.psqItem.Click += new System.EventHandler(this.psqItem_Click);
|
||||
//
|
||||
// psqCli
|
||||
//
|
||||
this.psqCli.Enabled = false;
|
||||
this.psqCli.Location = new System.Drawing.Point(440, 25);
|
||||
this.psqCli.Name = "psqCli";
|
||||
this.psqCli.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqCli.TabIndex = 74;
|
||||
this.psqCli.Text = "Pesquisar";
|
||||
this.psqCli.UseVisualStyleBackColor = true;
|
||||
this.psqCli.Click += new System.EventHandler(this.psqCli_Click);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label2.Location = new System.Drawing.Point(23, 58);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(93, 16);
|
||||
this.label2.TabIndex = 73;
|
||||
this.label2.Text = "Funcionario:";
|
||||
//
|
||||
// txtNomeFuncionario
|
||||
//
|
||||
this.txtNomeFuncionario.Enabled = false;
|
||||
this.txtNomeFuncionario.Location = new System.Drawing.Point(137, 54);
|
||||
this.txtNomeFuncionario.Name = "txtNomeFuncionario";
|
||||
this.txtNomeFuncionario.Size = new System.Drawing.Size(280, 20);
|
||||
this.txtNomeFuncionario.TabIndex = 72;
|
||||
//
|
||||
// btnSalvar
|
||||
//
|
||||
this.btnSalvar.Enabled = false;
|
||||
this.btnSalvar.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnSalvar.Location = new System.Drawing.Point(188, 195);
|
||||
this.btnSalvar.Name = "btnSalvar";
|
||||
this.btnSalvar.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnSalvar.TabIndex = 71;
|
||||
this.btnSalvar.Text = "Salvar";
|
||||
this.btnSalvar.UseVisualStyleBackColor = true;
|
||||
this.btnSalvar.Click += new System.EventHandler(this.btnSalvar_Click);
|
||||
//
|
||||
// btnLimpar
|
||||
//
|
||||
this.btnLimpar.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnLimpar.Location = new System.Drawing.Point(26, 195);
|
||||
this.btnLimpar.Name = "btnLimpar";
|
||||
this.btnLimpar.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnLimpar.TabIndex = 70;
|
||||
this.btnLimpar.Text = "Limpar";
|
||||
this.btnLimpar.UseVisualStyleBackColor = true;
|
||||
this.btnLimpar.Click += new System.EventHandler(this.btnLimpar_Click);
|
||||
//
|
||||
// txtNomeItem
|
||||
//
|
||||
this.txtNomeItem.Enabled = false;
|
||||
this.txtNomeItem.Location = new System.Drawing.Point(137, 83);
|
||||
this.txtNomeItem.Name = "txtNomeItem";
|
||||
this.txtNomeItem.Size = new System.Drawing.Size(280, 20);
|
||||
this.txtNomeItem.TabIndex = 69;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label7.Location = new System.Drawing.Point(23, 147);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(125, 16);
|
||||
this.label7.TabIndex = 68;
|
||||
this.label7.Text = "Data de Entrega:";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label6.Location = new System.Drawing.Point(23, 119);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(125, 16);
|
||||
this.label6.TabIndex = 67;
|
||||
this.label6.Text = "Data de retirada:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label5.Location = new System.Drawing.Point(23, 83);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(41, 16);
|
||||
this.label5.TabIndex = 66;
|
||||
this.label5.Text = "Item:";
|
||||
//
|
||||
// txtNomeCliente
|
||||
//
|
||||
this.txtNomeCliente.Enabled = false;
|
||||
this.txtNomeCliente.Location = new System.Drawing.Point(137, 27);
|
||||
this.txtNomeCliente.Name = "txtNomeCliente";
|
||||
this.txtNomeCliente.Size = new System.Drawing.Size(280, 20);
|
||||
this.txtNomeCliente.TabIndex = 65;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.Location = new System.Drawing.Point(22, 31);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(60, 16);
|
||||
this.label1.TabIndex = 64;
|
||||
this.label1.Text = "Cliente:";
|
||||
//
|
||||
// btnAlterar
|
||||
//
|
||||
this.btnAlterar.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnAlterar.Location = new System.Drawing.Point(107, 195);
|
||||
this.btnAlterar.Name = "btnAlterar";
|
||||
this.btnAlterar.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnAlterar.TabIndex = 79;
|
||||
this.btnAlterar.Text = "Alterar";
|
||||
this.btnAlterar.UseVisualStyleBackColor = true;
|
||||
this.btnAlterar.Click += new System.EventHandler(this.btnAlterar_Click);
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.AutoSize = true;
|
||||
this.checkBox1.Location = new System.Drawing.Point(440, 149);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.checkBox1.Size = new System.Drawing.Size(75, 17);
|
||||
this.checkBox1.TabIndex = 80;
|
||||
this.checkBox1.Text = "Entregue?";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// AlterarEmprestimo
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(529, 243);
|
||||
this.Controls.Add(this.checkBox1);
|
||||
this.Controls.Add(this.btnAlterar);
|
||||
this.Controls.Add(this.dateTimePicker2);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.psqItem);
|
||||
this.Controls.Add(this.psqCli);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.txtNomeFuncionario);
|
||||
this.Controls.Add(this.btnSalvar);
|
||||
this.Controls.Add(this.btnLimpar);
|
||||
this.Controls.Add(this.txtNomeItem);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.txtNomeCliente);
|
||||
this.Controls.Add(this.label1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "AlterarEmprestimo";
|
||||
this.Text = "AlterarEmprestimo";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AlterarEmprestimo_FormClosing);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker2;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.Button psqItem;
|
||||
private System.Windows.Forms.Button psqCli;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox txtNomeFuncionario;
|
||||
private System.Windows.Forms.Button btnSalvar;
|
||||
private System.Windows.Forms.Button btnLimpar;
|
||||
private System.Windows.Forms.TextBox txtNomeItem;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox txtNomeCliente;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button btnAlterar;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
}
|
||||
}
|
106
stuff/Item/AlterarEmprestimo.cs
Normal file
106
stuff/Item/AlterarEmprestimo.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Windows.Forms;
|
||||
using CSharpLibrary.SqlTypes;
|
||||
|
||||
namespace CSharpLibrary.stuff.Item
|
||||
{
|
||||
public partial class AlterarEmprestimo : Form
|
||||
{
|
||||
public Emprestimo ed = null;
|
||||
public CSharpLibrary.SqlTypes.Item i = null;
|
||||
public Funcionario f = null;
|
||||
public Cliente c = null;
|
||||
string str;
|
||||
Consulta ce = null;
|
||||
public AlterarEmprestimo(int id, Consulta ce)
|
||||
{
|
||||
|
||||
this.ce = ce;
|
||||
InitializeComponent();
|
||||
ed = ReturnTypes.AReturnEmprestimo(id);
|
||||
i = ReturnTypes.AReturnItem(ed.idItem);
|
||||
f = ReturnTypes.AReturnFuncionario(ed.idFunc);
|
||||
c = ReturnTypes.AReturnCliente(ed.idCliente);
|
||||
|
||||
txtNomeCliente.Text = c.nome;
|
||||
txtNomeItem.Text = i.nomeItem;
|
||||
txtNomeFuncionario.Text = f.nome;
|
||||
dateTimePicker1.Value = ed.dtEmprestimo;
|
||||
dateTimePicker2.Value = ed.dtDevolucao;
|
||||
checkBox1.Checked = (ed.statusEmprestimo.ToUpper() == "EMPRESTADO") ? false : true;
|
||||
|
||||
}
|
||||
|
||||
private void btnLimpar_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtNomeCliente.Clear();
|
||||
txtNomeItem.Clear();
|
||||
dateTimePicker1.ResetText();
|
||||
dateTimePicker2.ResetText();
|
||||
checkBox1.Checked = false;
|
||||
}
|
||||
|
||||
private void btnAlterar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(ed != null && f != null && i != null && c != null)
|
||||
{
|
||||
btnSalvar.Enabled = true;
|
||||
psqCli.Enabled = true;
|
||||
psqItem.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void psqCli_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 7);
|
||||
srch.Show();
|
||||
}
|
||||
|
||||
private void psqItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 5);
|
||||
srch.Show();
|
||||
}
|
||||
public void UpdateTxt()
|
||||
{
|
||||
txtNomeCliente.Text = c.nome;
|
||||
txtNomeItem.Text = i.nomeItem;
|
||||
txtNomeFuncionario.Text = f.nome;
|
||||
dateTimePicker1.Value = ed.dtEmprestimo;
|
||||
dateTimePicker2.Value = ed.dtDevolucao;
|
||||
checkBox1.Checked = (ed.statusEmprestimo.ToUpper() == "EMPRESTADO") ? false : true;
|
||||
}
|
||||
private void btnSalvar_Click(object sender, EventArgs e)
|
||||
{
|
||||
SqlException sql = null;
|
||||
try {
|
||||
str = (checkBox1.Checked == true) ? "ENTREGUE" : "EMPRESTADO";
|
||||
ed.Edit(ed.idEmprestimo, new List<string> {
|
||||
f.nome,
|
||||
c.nome,
|
||||
i.nomeItem,
|
||||
dateTimePicker1.Value.ToString(),
|
||||
dateTimePicker2.Value.ToString(),
|
||||
str
|
||||
});
|
||||
}
|
||||
catch (SqlException g)
|
||||
{
|
||||
sql = g;
|
||||
MessageBox.Show("Falha na alteração de dados!");
|
||||
}
|
||||
if (sql == null)
|
||||
{
|
||||
MessageBox.Show("Dados atualizados!");
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void AlterarEmprestimo_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
ce.Restart();
|
||||
}
|
||||
}
|
||||
}
|
120
stuff/Item/AlterarEmprestimo.resx
Normal file
120
stuff/Item/AlterarEmprestimo.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
292
stuff/Item/AlterarLivro.Designer.cs
generated
Normal file
292
stuff/Item/AlterarLivro.Designer.cs
generated
Normal file
@@ -0,0 +1,292 @@
|
||||
namespace TelasProjeto
|
||||
{
|
||||
partial class formAlterarLivro
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.lblAlterarLivro = new System.Windows.Forms.Label();
|
||||
this.txtISBN = new System.Windows.Forms.TextBox();
|
||||
this.lblISBN = new System.Windows.Forms.Label();
|
||||
this.lblTipoMidia = new System.Windows.Forms.Label();
|
||||
this.txtEditora = new System.Windows.Forms.TextBox();
|
||||
this.lblEditora = new System.Windows.Forms.Label();
|
||||
this.txtGenero = new System.Windows.Forms.TextBox();
|
||||
this.lblGenero = new System.Windows.Forms.Label();
|
||||
this.lblAutor = new System.Windows.Forms.Label();
|
||||
this.btnAlterarLivro = new System.Windows.Forms.Button();
|
||||
this.lblNomeLivro = new System.Windows.Forms.Label();
|
||||
this.txtNomeLivro = new System.Windows.Forms.TextBox();
|
||||
this.txtAutor = new System.Windows.Forms.TextBox();
|
||||
this.txtTipoMidia = new System.Windows.Forms.TextBox();
|
||||
this.statusLivro = new System.Windows.Forms.ComboBox();
|
||||
this.psqAutor = new System.Windows.Forms.Button();
|
||||
this.psqGenero = new System.Windows.Forms.Button();
|
||||
this.psqEditora = new System.Windows.Forms.Button();
|
||||
this.psqTipo = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblAlterarLivro
|
||||
//
|
||||
this.lblAlterarLivro.AutoSize = true;
|
||||
this.lblAlterarLivro.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblAlterarLivro.Location = new System.Drawing.Point(235, 35);
|
||||
this.lblAlterarLivro.Name = "lblAlterarLivro";
|
||||
this.lblAlterarLivro.Size = new System.Drawing.Size(49, 24);
|
||||
this.lblAlterarLivro.TabIndex = 0;
|
||||
this.lblAlterarLivro.Text = "Item";
|
||||
//
|
||||
// txtISBN
|
||||
//
|
||||
this.txtISBN.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtISBN.Location = new System.Drawing.Point(105, 267);
|
||||
this.txtISBN.Name = "txtISBN";
|
||||
this.txtISBN.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtISBN.TabIndex = 32;
|
||||
//
|
||||
// lblISBN
|
||||
//
|
||||
this.lblISBN.AutoSize = true;
|
||||
this.lblISBN.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblISBN.Location = new System.Drawing.Point(46, 270);
|
||||
this.lblISBN.Name = "lblISBN";
|
||||
this.lblISBN.Size = new System.Drawing.Size(46, 18);
|
||||
this.lblISBN.TabIndex = 31;
|
||||
this.lblISBN.Text = "ISBN:";
|
||||
//
|
||||
// lblTipoMidia
|
||||
//
|
||||
this.lblTipoMidia.AutoSize = true;
|
||||
this.lblTipoMidia.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblTipoMidia.Location = new System.Drawing.Point(46, 231);
|
||||
this.lblTipoMidia.Name = "lblTipoMidia";
|
||||
this.lblTipoMidia.Size = new System.Drawing.Size(41, 18);
|
||||
this.lblTipoMidia.TabIndex = 27;
|
||||
this.lblTipoMidia.Text = "Tipo:";
|
||||
//
|
||||
// txtEditora
|
||||
//
|
||||
this.txtEditora.Enabled = false;
|
||||
this.txtEditora.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtEditora.Location = new System.Drawing.Point(105, 190);
|
||||
this.txtEditora.Name = "txtEditora";
|
||||
this.txtEditora.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtEditora.TabIndex = 24;
|
||||
//
|
||||
// lblEditora
|
||||
//
|
||||
this.lblEditora.AutoSize = true;
|
||||
this.lblEditora.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblEditora.Location = new System.Drawing.Point(46, 193);
|
||||
this.lblEditora.Name = "lblEditora";
|
||||
this.lblEditora.Size = new System.Drawing.Size(59, 18);
|
||||
this.lblEditora.TabIndex = 23;
|
||||
this.lblEditora.Text = "Editora:";
|
||||
//
|
||||
// txtGenero
|
||||
//
|
||||
this.txtGenero.Enabled = false;
|
||||
this.txtGenero.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtGenero.Location = new System.Drawing.Point(105, 151);
|
||||
this.txtGenero.Name = "txtGenero";
|
||||
this.txtGenero.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtGenero.TabIndex = 22;
|
||||
//
|
||||
// lblGenero
|
||||
//
|
||||
this.lblGenero.AutoSize = true;
|
||||
this.lblGenero.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblGenero.Location = new System.Drawing.Point(46, 154);
|
||||
this.lblGenero.Name = "lblGenero";
|
||||
this.lblGenero.Size = new System.Drawing.Size(62, 18);
|
||||
this.lblGenero.TabIndex = 21;
|
||||
this.lblGenero.Text = "Gênero:";
|
||||
//
|
||||
// lblAutor
|
||||
//
|
||||
this.lblAutor.AutoSize = true;
|
||||
this.lblAutor.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblAutor.Location = new System.Drawing.Point(46, 117);
|
||||
this.lblAutor.Name = "lblAutor";
|
||||
this.lblAutor.Size = new System.Drawing.Size(47, 18);
|
||||
this.lblAutor.TabIndex = 20;
|
||||
this.lblAutor.Text = "Autor:";
|
||||
//
|
||||
// btnAlterarLivro
|
||||
//
|
||||
this.btnAlterarLivro.FlatAppearance.BorderSize = 3;
|
||||
this.btnAlterarLivro.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnAlterarLivro.Location = new System.Drawing.Point(289, 324);
|
||||
this.btnAlterarLivro.Name = "btnAlterarLivro";
|
||||
this.btnAlterarLivro.Size = new System.Drawing.Size(130, 32);
|
||||
this.btnAlterarLivro.TabIndex = 34;
|
||||
this.btnAlterarLivro.Text = "Alterar";
|
||||
this.btnAlterarLivro.UseMnemonic = false;
|
||||
this.btnAlterarLivro.UseVisualStyleBackColor = true;
|
||||
this.btnAlterarLivro.Click += new System.EventHandler(this.btnAlterarLivro_Click);
|
||||
//
|
||||
// lblNomeLivro
|
||||
//
|
||||
this.lblNomeLivro.AutoSize = true;
|
||||
this.lblNomeLivro.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblNomeLivro.Location = new System.Drawing.Point(46, 77);
|
||||
this.lblNomeLivro.Name = "lblNomeLivro";
|
||||
this.lblNomeLivro.Size = new System.Drawing.Size(53, 18);
|
||||
this.lblNomeLivro.TabIndex = 19;
|
||||
this.lblNomeLivro.Text = "Nome:";
|
||||
//
|
||||
// txtNomeLivro
|
||||
//
|
||||
this.txtNomeLivro.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtNomeLivro.Location = new System.Drawing.Point(105, 74);
|
||||
this.txtNomeLivro.Name = "txtNomeLivro";
|
||||
this.txtNomeLivro.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtNomeLivro.TabIndex = 17;
|
||||
//
|
||||
// txtAutor
|
||||
//
|
||||
this.txtAutor.Enabled = false;
|
||||
this.txtAutor.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtAutor.Location = new System.Drawing.Point(105, 114);
|
||||
this.txtAutor.Name = "txtAutor";
|
||||
this.txtAutor.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtAutor.TabIndex = 18;
|
||||
//
|
||||
// txtTipoMidia
|
||||
//
|
||||
this.txtTipoMidia.Enabled = false;
|
||||
this.txtTipoMidia.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtTipoMidia.Location = new System.Drawing.Point(105, 228);
|
||||
this.txtTipoMidia.Name = "txtTipoMidia";
|
||||
this.txtTipoMidia.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtTipoMidia.TabIndex = 28;
|
||||
//
|
||||
// statusLivro
|
||||
//
|
||||
this.statusLivro.FormattingEnabled = true;
|
||||
this.statusLivro.Items.AddRange(new object[] {
|
||||
"ATIVO",
|
||||
"DESATIVADO"});
|
||||
this.statusLivro.Location = new System.Drawing.Point(105, 297);
|
||||
this.statusLivro.Name = "statusLivro";
|
||||
this.statusLivro.Size = new System.Drawing.Size(314, 21);
|
||||
this.statusLivro.TabIndex = 39;
|
||||
//
|
||||
// psqAutor
|
||||
//
|
||||
this.psqAutor.Location = new System.Drawing.Point(425, 114);
|
||||
this.psqAutor.Name = "psqAutor";
|
||||
this.psqAutor.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqAutor.TabIndex = 40;
|
||||
this.psqAutor.Text = "Pesquisar";
|
||||
this.psqAutor.UseVisualStyleBackColor = true;
|
||||
this.psqAutor.Click += new System.EventHandler(this.psqAutor_Click);
|
||||
//
|
||||
// psqGenero
|
||||
//
|
||||
this.psqGenero.Location = new System.Drawing.Point(425, 151);
|
||||
this.psqGenero.Name = "psqGenero";
|
||||
this.psqGenero.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqGenero.TabIndex = 41;
|
||||
this.psqGenero.Text = "Pesquisar";
|
||||
this.psqGenero.UseVisualStyleBackColor = true;
|
||||
this.psqGenero.Click += new System.EventHandler(this.psqGenero_Click);
|
||||
//
|
||||
// psqEditora
|
||||
//
|
||||
this.psqEditora.Location = new System.Drawing.Point(425, 190);
|
||||
this.psqEditora.Name = "psqEditora";
|
||||
this.psqEditora.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqEditora.TabIndex = 42;
|
||||
this.psqEditora.Text = "Pesquisar";
|
||||
this.psqEditora.UseVisualStyleBackColor = true;
|
||||
this.psqEditora.Click += new System.EventHandler(this.psqEditora_Click);
|
||||
//
|
||||
// psqTipo
|
||||
//
|
||||
this.psqTipo.Location = new System.Drawing.Point(425, 228);
|
||||
this.psqTipo.Name = "psqTipo";
|
||||
this.psqTipo.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqTipo.TabIndex = 43;
|
||||
this.psqTipo.Text = "Pesquisar";
|
||||
this.psqTipo.UseVisualStyleBackColor = true;
|
||||
this.psqTipo.Click += new System.EventHandler(this.psqTipo_Click);
|
||||
//
|
||||
// formAlterarLivro
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(524, 404);
|
||||
this.Controls.Add(this.psqTipo);
|
||||
this.Controls.Add(this.psqEditora);
|
||||
this.Controls.Add(this.psqGenero);
|
||||
this.Controls.Add(this.psqAutor);
|
||||
this.Controls.Add(this.statusLivro);
|
||||
this.Controls.Add(this.btnAlterarLivro);
|
||||
this.Controls.Add(this.txtISBN);
|
||||
this.Controls.Add(this.lblISBN);
|
||||
this.Controls.Add(this.txtTipoMidia);
|
||||
this.Controls.Add(this.lblTipoMidia);
|
||||
this.Controls.Add(this.txtEditora);
|
||||
this.Controls.Add(this.lblEditora);
|
||||
this.Controls.Add(this.txtGenero);
|
||||
this.Controls.Add(this.lblGenero);
|
||||
this.Controls.Add(this.lblAutor);
|
||||
this.Controls.Add(this.lblNomeLivro);
|
||||
this.Controls.Add(this.txtAutor);
|
||||
this.Controls.Add(this.txtNomeLivro);
|
||||
this.Controls.Add(this.lblAlterarLivro);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "formAlterarLivro";
|
||||
this.Text = "Alterar Livro";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblAlterarLivro;
|
||||
private System.Windows.Forms.TextBox txtISBN;
|
||||
private System.Windows.Forms.Label lblISBN;
|
||||
private System.Windows.Forms.Label lblTipoMidia;
|
||||
private System.Windows.Forms.TextBox txtEditora;
|
||||
private System.Windows.Forms.Label lblEditora;
|
||||
private System.Windows.Forms.TextBox txtGenero;
|
||||
private System.Windows.Forms.Label lblGenero;
|
||||
private System.Windows.Forms.Label lblAutor;
|
||||
private System.Windows.Forms.Button btnAlterarLivro;
|
||||
private System.Windows.Forms.Label lblNomeLivro;
|
||||
private System.Windows.Forms.TextBox txtNomeLivro;
|
||||
private System.Windows.Forms.TextBox txtAutor;
|
||||
private System.Windows.Forms.TextBox txtTipoMidia;
|
||||
private System.Windows.Forms.ComboBox statusLivro;
|
||||
private System.Windows.Forms.Button psqAutor;
|
||||
private System.Windows.Forms.Button psqGenero;
|
||||
private System.Windows.Forms.Button psqEditora;
|
||||
private System.Windows.Forms.Button psqTipo;
|
||||
}
|
||||
}
|
110
stuff/Item/AlterarLivro.cs
Normal file
110
stuff/Item/AlterarLivro.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Windows.Forms;
|
||||
using CSharpLibrary.SqlTypes;
|
||||
using CSharpLibrary.stuff;
|
||||
|
||||
|
||||
namespace TelasProjeto
|
||||
{
|
||||
public partial class formAlterarLivro : Form
|
||||
{
|
||||
public int? id1, id2, id3, id4;
|
||||
public int idI = -9999;
|
||||
|
||||
private void psqAutor_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 1);
|
||||
srch.Show();
|
||||
}
|
||||
|
||||
private void psqGenero_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 2);
|
||||
srch.Show();
|
||||
}
|
||||
|
||||
private void psqEditora_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 3);
|
||||
srch.Show();
|
||||
}
|
||||
|
||||
private void psqTipo_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 4);
|
||||
srch.Show();
|
||||
}
|
||||
|
||||
private void btnAlterarLivro_Click(object sender, EventArgs e)
|
||||
{
|
||||
Item i = new Item(idI,"1", 1, 1, 1, 1, "1","1");
|
||||
SqlException sql = null;
|
||||
try {
|
||||
i.Edit(idI, new List<string>
|
||||
{ txtNomeLivro.Text, //0
|
||||
txtAutor.Text, // 1
|
||||
txtGenero.Text, // 2
|
||||
txtEditora.Text, // 3
|
||||
txtTipoMidia.Text, // 4
|
||||
txtISBN.Text, // 5
|
||||
statusLivro.SelectedItem.ToString()} // 6
|
||||
|
||||
// (string Autor, string Genero, string Editora, string Tipo)
|
||||
// Return para pegar PK!!
|
||||
// Vlr[0], [5], [6] -> nomeItem, isbnItem, statusItem;
|
||||
// Vlr[1], [2], [3], [4] -> idAutor,generoItem,editoraItem,tipoItem;
|
||||
);
|
||||
}
|
||||
catch(SqlException g)
|
||||
{
|
||||
sql = g;
|
||||
MessageBox.Show("Falha na alteração de dados!");
|
||||
}
|
||||
if(sql == null)
|
||||
{
|
||||
MessageBox.Show("Dados atualizados!");
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public string n1, n2, n3, n4;
|
||||
|
||||
public formAlterarLivro(List<Tuple<int,string>> a)
|
||||
{
|
||||
idI = a[0].Item1;
|
||||
List<string> tmp = new List<string>();
|
||||
foreach (Tuple<int, string> b in a)
|
||||
tmp.Add(b.Item2);
|
||||
InitializeComponent();
|
||||
txtNomeLivro.Text = tmp[0];
|
||||
txtAutor.Text = tmp[1];
|
||||
txtGenero.Text = tmp[2];
|
||||
txtEditora.Text = tmp[3];
|
||||
txtTipoMidia.Text = tmp[4];
|
||||
txtISBN.Text = tmp[5];
|
||||
statusLivro.SelectedItem = tmp[6];
|
||||
}
|
||||
public void UpdateTxt()
|
||||
{
|
||||
if(n1 != null)
|
||||
{
|
||||
txtAutor.Text = n1;
|
||||
}
|
||||
if (n2 != null)
|
||||
{
|
||||
txtGenero.Text = n2;
|
||||
}
|
||||
if (n3 != null)
|
||||
{
|
||||
txtEditora.Text = n3;
|
||||
}
|
||||
if (n4 != null)
|
||||
{
|
||||
txtTipoMidia.Text = n4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
stuff/Item/AlterarLivro.resx
Normal file
120
stuff/Item/AlterarLivro.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
303
stuff/Item/CadastroLivros.Designer.cs
generated
Normal file
303
stuff/Item/CadastroLivros.Designer.cs
generated
Normal file
@@ -0,0 +1,303 @@
|
||||
namespace ProjetoLPVIII
|
||||
{
|
||||
partial class Cadastro_de_Livros
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btnSalvar = new System.Windows.Forms.Button();
|
||||
this.btnLimpar = new System.Windows.Forms.Button();
|
||||
this.psqTipo = new System.Windows.Forms.Button();
|
||||
this.psqEditora = new System.Windows.Forms.Button();
|
||||
this.psqGenero = new System.Windows.Forms.Button();
|
||||
this.psqAutor = new System.Windows.Forms.Button();
|
||||
this.statusLivro = new System.Windows.Forms.ComboBox();
|
||||
this.txtISBN = new System.Windows.Forms.TextBox();
|
||||
this.lblISBN = new System.Windows.Forms.Label();
|
||||
this.txtTipoMidia = new System.Windows.Forms.TextBox();
|
||||
this.lblTipoMidia = new System.Windows.Forms.Label();
|
||||
this.txtEditora = new System.Windows.Forms.TextBox();
|
||||
this.lblEditora = new System.Windows.Forms.Label();
|
||||
this.txtGenero = new System.Windows.Forms.TextBox();
|
||||
this.lblGenero = new System.Windows.Forms.Label();
|
||||
this.lblAutor = new System.Windows.Forms.Label();
|
||||
this.lblNomeLivro = new System.Windows.Forms.Label();
|
||||
this.txtAutor = new System.Windows.Forms.TextBox();
|
||||
this.txtNomeLivro = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnSalvar
|
||||
//
|
||||
this.btnSalvar.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnSalvar.Location = new System.Drawing.Point(29, 371);
|
||||
this.btnSalvar.Name = "btnSalvar";
|
||||
this.btnSalvar.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnSalvar.TabIndex = 12;
|
||||
this.btnSalvar.Text = "Salvar";
|
||||
this.btnSalvar.UseVisualStyleBackColor = true;
|
||||
this.btnSalvar.Click += new System.EventHandler(this.btnSalvar_Click);
|
||||
//
|
||||
// btnLimpar
|
||||
//
|
||||
this.btnLimpar.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnLimpar.Location = new System.Drawing.Point(110, 371);
|
||||
this.btnLimpar.Name = "btnLimpar";
|
||||
this.btnLimpar.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnLimpar.TabIndex = 13;
|
||||
this.btnLimpar.Text = "Limpar";
|
||||
this.btnLimpar.UseVisualStyleBackColor = true;
|
||||
this.btnLimpar.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// psqTipo
|
||||
//
|
||||
this.psqTipo.Location = new System.Drawing.Point(405, 245);
|
||||
this.psqTipo.Name = "psqTipo";
|
||||
this.psqTipo.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqTipo.TabIndex = 60;
|
||||
this.psqTipo.Text = "Pesquisar";
|
||||
this.psqTipo.UseVisualStyleBackColor = true;
|
||||
this.psqTipo.Click += new System.EventHandler(this.psqTipo_Click);
|
||||
//
|
||||
// psqEditora
|
||||
//
|
||||
this.psqEditora.Location = new System.Drawing.Point(405, 207);
|
||||
this.psqEditora.Name = "psqEditora";
|
||||
this.psqEditora.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqEditora.TabIndex = 59;
|
||||
this.psqEditora.Text = "Pesquisar";
|
||||
this.psqEditora.UseVisualStyleBackColor = true;
|
||||
this.psqEditora.Click += new System.EventHandler(this.psqEditora_Click);
|
||||
//
|
||||
// psqGenero
|
||||
//
|
||||
this.psqGenero.Location = new System.Drawing.Point(405, 168);
|
||||
this.psqGenero.Name = "psqGenero";
|
||||
this.psqGenero.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqGenero.TabIndex = 58;
|
||||
this.psqGenero.Text = "Pesquisar";
|
||||
this.psqGenero.UseVisualStyleBackColor = true;
|
||||
this.psqGenero.Click += new System.EventHandler(this.psqGenero_Click);
|
||||
//
|
||||
// psqAutor
|
||||
//
|
||||
this.psqAutor.Location = new System.Drawing.Point(405, 131);
|
||||
this.psqAutor.Name = "psqAutor";
|
||||
this.psqAutor.Size = new System.Drawing.Size(75, 23);
|
||||
this.psqAutor.TabIndex = 57;
|
||||
this.psqAutor.Text = "Pesquisar";
|
||||
this.psqAutor.UseVisualStyleBackColor = true;
|
||||
this.psqAutor.Click += new System.EventHandler(this.psqAutor_Click);
|
||||
//
|
||||
// statusLivro
|
||||
//
|
||||
this.statusLivro.FormattingEnabled = true;
|
||||
this.statusLivro.Items.AddRange(new object[] {
|
||||
"ATIVO",
|
||||
"DESATIVADO"});
|
||||
this.statusLivro.Location = new System.Drawing.Point(85, 314);
|
||||
this.statusLivro.Name = "statusLivro";
|
||||
this.statusLivro.Size = new System.Drawing.Size(314, 21);
|
||||
this.statusLivro.TabIndex = 56;
|
||||
//
|
||||
// txtISBN
|
||||
//
|
||||
this.txtISBN.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtISBN.Location = new System.Drawing.Point(85, 284);
|
||||
this.txtISBN.Name = "txtISBN";
|
||||
this.txtISBN.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtISBN.TabIndex = 55;
|
||||
//
|
||||
// lblISBN
|
||||
//
|
||||
this.lblISBN.AutoSize = true;
|
||||
this.lblISBN.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblISBN.Location = new System.Drawing.Point(26, 287);
|
||||
this.lblISBN.Name = "lblISBN";
|
||||
this.lblISBN.Size = new System.Drawing.Size(46, 18);
|
||||
this.lblISBN.TabIndex = 54;
|
||||
this.lblISBN.Text = "ISBN:";
|
||||
//
|
||||
// txtTipoMidia
|
||||
//
|
||||
this.txtTipoMidia.Enabled = false;
|
||||
this.txtTipoMidia.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtTipoMidia.Location = new System.Drawing.Point(85, 245);
|
||||
this.txtTipoMidia.Name = "txtTipoMidia";
|
||||
this.txtTipoMidia.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtTipoMidia.TabIndex = 53;
|
||||
//
|
||||
// lblTipoMidia
|
||||
//
|
||||
this.lblTipoMidia.AutoSize = true;
|
||||
this.lblTipoMidia.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblTipoMidia.Location = new System.Drawing.Point(26, 248);
|
||||
this.lblTipoMidia.Name = "lblTipoMidia";
|
||||
this.lblTipoMidia.Size = new System.Drawing.Size(41, 18);
|
||||
this.lblTipoMidia.TabIndex = 52;
|
||||
this.lblTipoMidia.Text = "Tipo:";
|
||||
//
|
||||
// txtEditora
|
||||
//
|
||||
this.txtEditora.Enabled = false;
|
||||
this.txtEditora.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtEditora.Location = new System.Drawing.Point(85, 207);
|
||||
this.txtEditora.Name = "txtEditora";
|
||||
this.txtEditora.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtEditora.TabIndex = 51;
|
||||
//
|
||||
// lblEditora
|
||||
//
|
||||
this.lblEditora.AutoSize = true;
|
||||
this.lblEditora.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblEditora.Location = new System.Drawing.Point(26, 210);
|
||||
this.lblEditora.Name = "lblEditora";
|
||||
this.lblEditora.Size = new System.Drawing.Size(59, 18);
|
||||
this.lblEditora.TabIndex = 50;
|
||||
this.lblEditora.Text = "Editora:";
|
||||
//
|
||||
// txtGenero
|
||||
//
|
||||
this.txtGenero.Enabled = false;
|
||||
this.txtGenero.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtGenero.Location = new System.Drawing.Point(85, 168);
|
||||
this.txtGenero.Name = "txtGenero";
|
||||
this.txtGenero.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtGenero.TabIndex = 49;
|
||||
//
|
||||
// lblGenero
|
||||
//
|
||||
this.lblGenero.AutoSize = true;
|
||||
this.lblGenero.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblGenero.Location = new System.Drawing.Point(26, 171);
|
||||
this.lblGenero.Name = "lblGenero";
|
||||
this.lblGenero.Size = new System.Drawing.Size(62, 18);
|
||||
this.lblGenero.TabIndex = 48;
|
||||
this.lblGenero.Text = "Gênero:";
|
||||
//
|
||||
// lblAutor
|
||||
//
|
||||
this.lblAutor.AutoSize = true;
|
||||
this.lblAutor.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblAutor.Location = new System.Drawing.Point(26, 134);
|
||||
this.lblAutor.Name = "lblAutor";
|
||||
this.lblAutor.Size = new System.Drawing.Size(47, 18);
|
||||
this.lblAutor.TabIndex = 47;
|
||||
this.lblAutor.Text = "Autor:";
|
||||
//
|
||||
// lblNomeLivro
|
||||
//
|
||||
this.lblNomeLivro.AutoSize = true;
|
||||
this.lblNomeLivro.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblNomeLivro.Location = new System.Drawing.Point(26, 94);
|
||||
this.lblNomeLivro.Name = "lblNomeLivro";
|
||||
this.lblNomeLivro.Size = new System.Drawing.Size(53, 18);
|
||||
this.lblNomeLivro.TabIndex = 46;
|
||||
this.lblNomeLivro.Text = "Nome:";
|
||||
//
|
||||
// txtAutor
|
||||
//
|
||||
this.txtAutor.Enabled = false;
|
||||
this.txtAutor.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtAutor.Location = new System.Drawing.Point(85, 131);
|
||||
this.txtAutor.Name = "txtAutor";
|
||||
this.txtAutor.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtAutor.TabIndex = 45;
|
||||
//
|
||||
// txtNomeLivro
|
||||
//
|
||||
this.txtNomeLivro.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtNomeLivro.Location = new System.Drawing.Point(85, 91);
|
||||
this.txtNomeLivro.Name = "txtNomeLivro";
|
||||
this.txtNomeLivro.Size = new System.Drawing.Size(314, 24);
|
||||
this.txtNomeLivro.TabIndex = 44;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.Location = new System.Drawing.Point(24, 34);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(199, 25);
|
||||
this.label1.TabIndex = 61;
|
||||
this.label1.Text = "Cadastro de Livro";
|
||||
//
|
||||
// Cadastro_de_Livros
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(514, 425);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.psqTipo);
|
||||
this.Controls.Add(this.psqEditora);
|
||||
this.Controls.Add(this.psqGenero);
|
||||
this.Controls.Add(this.psqAutor);
|
||||
this.Controls.Add(this.statusLivro);
|
||||
this.Controls.Add(this.txtISBN);
|
||||
this.Controls.Add(this.lblISBN);
|
||||
this.Controls.Add(this.txtTipoMidia);
|
||||
this.Controls.Add(this.lblTipoMidia);
|
||||
this.Controls.Add(this.txtEditora);
|
||||
this.Controls.Add(this.lblEditora);
|
||||
this.Controls.Add(this.txtGenero);
|
||||
this.Controls.Add(this.lblGenero);
|
||||
this.Controls.Add(this.lblAutor);
|
||||
this.Controls.Add(this.lblNomeLivro);
|
||||
this.Controls.Add(this.txtAutor);
|
||||
this.Controls.Add(this.txtNomeLivro);
|
||||
this.Controls.Add(this.btnLimpar);
|
||||
this.Controls.Add(this.btnSalvar);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "Cadastro_de_Livros";
|
||||
this.Text = "Cadastro de Livros";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Button btnSalvar;
|
||||
private System.Windows.Forms.Button btnLimpar;
|
||||
private System.Windows.Forms.Button psqTipo;
|
||||
private System.Windows.Forms.Button psqEditora;
|
||||
private System.Windows.Forms.Button psqGenero;
|
||||
private System.Windows.Forms.Button psqAutor;
|
||||
private System.Windows.Forms.ComboBox statusLivro;
|
||||
private System.Windows.Forms.TextBox txtISBN;
|
||||
private System.Windows.Forms.Label lblISBN;
|
||||
private System.Windows.Forms.TextBox txtTipoMidia;
|
||||
private System.Windows.Forms.Label lblTipoMidia;
|
||||
private System.Windows.Forms.TextBox txtEditora;
|
||||
private System.Windows.Forms.Label lblEditora;
|
||||
private System.Windows.Forms.TextBox txtGenero;
|
||||
private System.Windows.Forms.Label lblGenero;
|
||||
private System.Windows.Forms.Label lblAutor;
|
||||
private System.Windows.Forms.Label lblNomeLivro;
|
||||
private System.Windows.Forms.TextBox txtAutor;
|
||||
private System.Windows.Forms.TextBox txtNomeLivro;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
98
stuff/Item/CadastroLivros.cs
Normal file
98
stuff/Item/CadastroLivros.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using CSharpLibrary.stuff;
|
||||
using CSharpLibrary.SqlTypes;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace ProjetoLPVIII
|
||||
{
|
||||
public partial class Cadastro_de_Livros : Form
|
||||
{
|
||||
public int? id1, id2, id3, id4;
|
||||
public string n1, n2, n3, n4;
|
||||
public int idI = -9999;
|
||||
public Cadastro_de_Livros()
|
||||
{
|
||||
InitializeComponent();
|
||||
Clean();
|
||||
}
|
||||
|
||||
private void Clean()
|
||||
{
|
||||
txtAutor.Clear();
|
||||
txtEditora.Clear();
|
||||
txtGenero.Clear();
|
||||
txtISBN.Clear();
|
||||
txtNomeLivro.Clear();
|
||||
txtTipoMidia.Clear();
|
||||
statusLivro.Text = "";
|
||||
}
|
||||
|
||||
private void btnSalvar_Click(object sender, EventArgs e)
|
||||
{
|
||||
SqlException sql = null;
|
||||
try {
|
||||
Item i = new Item(null, txtNomeLivro.Text, (int)id1,(int)id2,(int)id3,(int)id4,txtISBN.Text.ToString(),statusLivro.SelectedItem.ToString());
|
||||
i.Add();
|
||||
}
|
||||
catch (SqlException g)
|
||||
{
|
||||
sql = g;
|
||||
MessageBox.Show("Falha no cadastro!");
|
||||
}
|
||||
if (sql == null)
|
||||
{
|
||||
MessageBox.Show("Item Cadastrado!");
|
||||
Clean();
|
||||
}
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
private void psqAutor_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 1);
|
||||
srch.Show();
|
||||
}
|
||||
|
||||
private void psqGenero_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 2);
|
||||
srch.Show();
|
||||
}
|
||||
|
||||
private void psqEditora_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 3);
|
||||
srch.Show();
|
||||
}
|
||||
|
||||
private void psqTipo_Click(object sender, EventArgs e)
|
||||
{
|
||||
search srch = new search(this, 4);
|
||||
srch.Show();
|
||||
}
|
||||
public void UpdateTxt()
|
||||
{
|
||||
if (n1 != null)
|
||||
{
|
||||
txtAutor.Text = n1;
|
||||
}
|
||||
if (n2 != null)
|
||||
{
|
||||
txtGenero.Text = n2;
|
||||
}
|
||||
if (n3 != null)
|
||||
{
|
||||
txtEditora.Text = n3;
|
||||
}
|
||||
if (n4 != null)
|
||||
{
|
||||
txtTipoMidia.Text = n4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
stuff/Item/CadastroLivros.resx
Normal file
120
stuff/Item/CadastroLivros.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
121
stuff/Item/ConsultaLivro.Designer.cs
generated
Normal file
121
stuff/Item/ConsultaLivro.Designer.cs
generated
Normal file
@@ -0,0 +1,121 @@
|
||||
namespace TelasProjeto
|
||||
{
|
||||
partial class Form5
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.lblConsultarLivro = new System.Windows.Forms.Label();
|
||||
this.lblLivro = new System.Windows.Forms.Label();
|
||||
this.txtLivro = new System.Windows.Forms.TextBox();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.btnConsultar = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblConsultarLivro
|
||||
//
|
||||
this.lblConsultarLivro.AutoSize = true;
|
||||
this.lblConsultarLivro.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblConsultarLivro.Location = new System.Drawing.Point(48, 26);
|
||||
this.lblConsultarLivro.Name = "lblConsultarLivro";
|
||||
this.lblConsultarLivro.Size = new System.Drawing.Size(143, 24);
|
||||
this.lblConsultarLivro.TabIndex = 54;
|
||||
this.lblConsultarLivro.Text = "Consultar Item";
|
||||
//
|
||||
// lblLivro
|
||||
//
|
||||
this.lblLivro.AutoSize = true;
|
||||
this.lblLivro.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblLivro.Location = new System.Drawing.Point(49, 72);
|
||||
this.lblLivro.Name = "lblLivro";
|
||||
this.lblLivro.Size = new System.Drawing.Size(40, 18);
|
||||
this.lblLivro.TabIndex = 56;
|
||||
this.lblLivro.Text = "Item:";
|
||||
//
|
||||
// txtLivro
|
||||
//
|
||||
this.txtLivro.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtLivro.Location = new System.Drawing.Point(95, 69);
|
||||
this.txtLivro.Name = "txtLivro";
|
||||
this.txtLivro.Size = new System.Drawing.Size(919, 24);
|
||||
this.txtLivro.TabIndex = 55;
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.AllowUserToOrderColumns = true;
|
||||
this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(52, 110);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(962, 373);
|
||||
this.dataGridView1.TabIndex = 59;
|
||||
this.dataGridView1.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_CellMouseDoubleClick);
|
||||
//
|
||||
// btnConsultar
|
||||
//
|
||||
this.btnConsultar.FlatAppearance.BorderSize = 3;
|
||||
this.btnConsultar.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnConsultar.Location = new System.Drawing.Point(52, 498);
|
||||
this.btnConsultar.Name = "btnConsultar";
|
||||
this.btnConsultar.Size = new System.Drawing.Size(102, 32);
|
||||
this.btnConsultar.TabIndex = 58;
|
||||
this.btnConsultar.Text = "Consultar";
|
||||
this.btnConsultar.UseMnemonic = false;
|
||||
this.btnConsultar.UseVisualStyleBackColor = true;
|
||||
this.btnConsultar.Click += new System.EventHandler(this.btnConsultar_Click);
|
||||
//
|
||||
// Form5
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1058, 565);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Controls.Add(this.btnConsultar);
|
||||
this.Controls.Add(this.lblLivro);
|
||||
this.Controls.Add(this.txtLivro);
|
||||
this.Controls.Add(this.lblConsultarLivro);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "Form5";
|
||||
this.Text = "Consultar Item";
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblConsultarLivro;
|
||||
private System.Windows.Forms.Label lblLivro;
|
||||
private System.Windows.Forms.TextBox txtLivro;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Button btnConsultar;
|
||||
}
|
||||
}
|
51
stuff/Item/ConsultaLivro.cs
Normal file
51
stuff/Item/ConsultaLivro.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Windows.Forms;
|
||||
using CSharpLibrary;
|
||||
using CSharpLibrary.SqlTypes;
|
||||
|
||||
namespace TelasProjeto
|
||||
{
|
||||
public partial class Form5 : Form
|
||||
{
|
||||
public Form5()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
DataSet ds = ReturnTypes.DSReturnItemByName(txtLivro.Text);
|
||||
dataGridView1.DataSource = ds;
|
||||
dataGridView1.DataMember = ds.Tables[0].TableName;
|
||||
}
|
||||
|
||||
private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
|
||||
{
|
||||
if(e.RowIndex >= 0 && e.ColumnIndex >= 0)
|
||||
{
|
||||
int tmp = 0,i = e.RowIndex;
|
||||
List<Tuple<int, string>> a = new List<Tuple<int, string>>();
|
||||
foreach(DataGridViewRow datarow in dataGridView1.Rows)
|
||||
{
|
||||
foreach(DataGridViewCell c in datarow.Cells)
|
||||
{
|
||||
if (c.RowIndex == i)
|
||||
{
|
||||
if (c.ColumnIndex == 0)
|
||||
tmp = (int)c.Value;
|
||||
else
|
||||
{
|
||||
a.Add(
|
||||
new Tuple<int,string>(tmp, c.Value.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
formAlterarLivro f = new formAlterarLivro(a);
|
||||
f.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
stuff/Item/ConsultaLivro.resx
Normal file
120
stuff/Item/ConsultaLivro.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
91
stuff/Item/search.Designer.cs
generated
Normal file
91
stuff/Item/search.Designer.cs
generated
Normal file
@@ -0,0 +1,91 @@
|
||||
namespace CSharpLibrary.stuff
|
||||
{
|
||||
partial class search
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.txtQuery = new System.Windows.Forms.TextBox();
|
||||
this.btnQuery = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtQuery
|
||||
//
|
||||
this.txtQuery.Location = new System.Drawing.Point(12, 29);
|
||||
this.txtQuery.Name = "txtQuery";
|
||||
this.txtQuery.Size = new System.Drawing.Size(295, 20);
|
||||
this.txtQuery.TabIndex = 0;
|
||||
//
|
||||
// btnQuery
|
||||
//
|
||||
this.btnQuery.Location = new System.Drawing.Point(327, 27);
|
||||
this.btnQuery.Name = "btnQuery";
|
||||
this.btnQuery.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnQuery.TabIndex = 1;
|
||||
this.btnQuery.Text = "Pesquisar";
|
||||
this.btnQuery.UseVisualStyleBackColor = true;
|
||||
this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click);
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(12, 56);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.ShowEditingIcon = false;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(479, 250);
|
||||
this.dataGridView1.TabIndex = 2;
|
||||
this.dataGridView1.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_CellMouseDoubleClick);
|
||||
//
|
||||
// search
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(503, 318);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Controls.Add(this.btnQuery);
|
||||
this.Controls.Add(this.txtQuery);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
|
||||
this.Name = "search";
|
||||
this.Text = "Pesquisar";
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox txtQuery;
|
||||
private System.Windows.Forms.Button btnQuery;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
}
|
||||
}
|
185
stuff/Item/search.cs
Normal file
185
stuff/Item/search.cs
Normal file
@@ -0,0 +1,185 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Windows.Forms;
|
||||
using CSharpLibrary.SqlTypes;
|
||||
using TelasProjeto;
|
||||
using ProjetoLPVIII;
|
||||
using CSharpLibrary.stuff.Item;
|
||||
|
||||
namespace CSharpLibrary.stuff
|
||||
{
|
||||
public partial class search : Form
|
||||
{
|
||||
int f = 0;
|
||||
object Frm;
|
||||
public search(object frm, int i)
|
||||
{
|
||||
f = i;
|
||||
Frm = frm;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnQuery_Click(object sender, EventArgs e)
|
||||
{
|
||||
DataSet ds = new DataSet();
|
||||
switch (f)
|
||||
{
|
||||
case 1:
|
||||
ds = ReturnTypes.DSReturnAutorByName(txtQuery.Text);
|
||||
break;
|
||||
case 3:
|
||||
ds = ReturnTypes.DSReturnEditoraByName(txtQuery.Text);
|
||||
break;
|
||||
case 2:
|
||||
ds = ReturnTypes.DSReturnGeneroByName(txtQuery.Text);
|
||||
break;
|
||||
case 4:
|
||||
ds = ReturnTypes.DSReturnTipoByName(txtQuery.Text);
|
||||
break;
|
||||
case 5:
|
||||
ds = ReturnTypes.DSReturnItemByName(txtQuery.Text);
|
||||
break;
|
||||
case 6:
|
||||
ds = ReturnTypes.DSReturnFuncionarioByName(txtQuery.Text);
|
||||
break;
|
||||
case 7:
|
||||
ds = ReturnTypes.DSReturnClienteByName(txtQuery.Text);
|
||||
break;
|
||||
case 8:
|
||||
ds = ReturnTypes.DSReturnEmprestimoByName(txtQuery.Text);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
dataGridView1.DataSource = ds;
|
||||
dataGridView1.DataMember = ds.Tables[0].TableName;
|
||||
}
|
||||
|
||||
Cliente GetCliente(int i)
|
||||
{
|
||||
return ReturnTypes.AReturnCliente(i);
|
||||
}
|
||||
CSharpLibrary.SqlTypes.Item GetItem(int i)
|
||||
{
|
||||
return ReturnTypes.AReturnItem(i);
|
||||
}
|
||||
|
||||
private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
|
||||
{
|
||||
int tmp = -9999;
|
||||
if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
|
||||
{
|
||||
int i = e.RowIndex;
|
||||
string a = "";
|
||||
|
||||
foreach (DataGridViewRow datarow in dataGridView1.Rows)
|
||||
{
|
||||
foreach (DataGridViewCell c in datarow.Cells)
|
||||
{
|
||||
if (c.RowIndex == i)
|
||||
{
|
||||
if (c.ColumnIndex == 0)
|
||||
tmp = (int)c.Value;
|
||||
else
|
||||
a = (string)c.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Frm.GetType() == typeof(Retirada_de_livros))
|
||||
{
|
||||
switch (f)
|
||||
{
|
||||
case 7:
|
||||
(Frm as Retirada_de_livros).c = GetCliente(tmp);
|
||||
(Frm as Retirada_de_livros).UpdateTxt();
|
||||
break;
|
||||
case 5:
|
||||
(Frm as Retirada_de_livros).i = GetItem(tmp);
|
||||
(Frm as Retirada_de_livros).UpdateTxt();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (Frm.GetType() == typeof(AlterarEmprestimo))
|
||||
{
|
||||
switch (f)
|
||||
{
|
||||
case 7:
|
||||
(Frm as AlterarEmprestimo).c = GetCliente(tmp);
|
||||
(Frm as AlterarEmprestimo).UpdateTxt();
|
||||
break;
|
||||
case 5:
|
||||
(Frm as AlterarEmprestimo).i = GetItem(tmp);
|
||||
(Frm as AlterarEmprestimo).UpdateTxt();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (Frm.GetType() == typeof(formConsultarCliente))
|
||||
{
|
||||
(Frm as formConsultarCliente).c1 = GetCliente(tmp);
|
||||
(Frm as formConsultarCliente).UpdateTxt();
|
||||
}
|
||||
|
||||
|
||||
if (Frm.GetType() == typeof(formAlterarLivro))
|
||||
{
|
||||
switch (f)
|
||||
{
|
||||
case 1:
|
||||
(Frm as formAlterarLivro).id1 = tmp;
|
||||
(Frm as formAlterarLivro).n1 = a;
|
||||
break;
|
||||
case 2:
|
||||
(Frm as formAlterarLivro).id2 = tmp;
|
||||
(Frm as formAlterarLivro).n2 = a;
|
||||
break;
|
||||
case 3:
|
||||
(Frm as formAlterarLivro).id3 = tmp;
|
||||
(Frm as formAlterarLivro).n3 = a;
|
||||
break;
|
||||
case 4:
|
||||
(Frm as formAlterarLivro).id4 = tmp;
|
||||
(Frm as formAlterarLivro).n4 = a;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
(Frm as formAlterarLivro).UpdateTxt();
|
||||
}
|
||||
if (Frm.GetType() == typeof(Cadastro_de_Livros))
|
||||
{
|
||||
switch (f)
|
||||
{
|
||||
case 1:
|
||||
(Frm as Cadastro_de_Livros).id1 = tmp;
|
||||
(Frm as Cadastro_de_Livros).n1 = a;
|
||||
break;
|
||||
case 2:
|
||||
(Frm as Cadastro_de_Livros).id2 = tmp;
|
||||
(Frm as Cadastro_de_Livros).n2 = a;
|
||||
break;
|
||||
case 3:
|
||||
(Frm as Cadastro_de_Livros).id3 = tmp;
|
||||
(Frm as Cadastro_de_Livros).n3 = a;
|
||||
break;
|
||||
case 4:
|
||||
(Frm as Cadastro_de_Livros).id4 = tmp;
|
||||
(Frm as Cadastro_de_Livros).n4 = a;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
(Frm as Cadastro_de_Livros).UpdateTxt();
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
stuff/Item/search.resx
Normal file
120
stuff/Item/search.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
Reference in New Issue
Block a user