initial commit
This commit is contained in:
53
stuff/Consulta.cs
Normal file
53
stuff/Consulta.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using CSharpLibrary.SqlTypes;
|
||||
using CSharpLibrary.stuff.Item;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CSharpLibrary.stuff
|
||||
{
|
||||
public partial class Consulta : Form
|
||||
{
|
||||
public Consulta()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataSet ds = ReturnTypes.DSReturnEmprestimoAtivo();
|
||||
dataGridView1.DataSource = ds;
|
||||
dataGridView1.DataMember = ds.Tables[0].TableName;
|
||||
}
|
||||
public void Restart()
|
||||
{
|
||||
DataSet ds = ReturnTypes.DSReturnEmprestimoAtivo();
|
||||
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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
AlterarEmprestimo f = new AlterarEmprestimo(tmp, this);
|
||||
f.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user