-
Notifications
You must be signed in to change notification settings - Fork 0
/
PartsStats.cs
52 lines (45 loc) · 1.41 KB
/
PartsStats.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace TowerSearch
{
public partial class PartsStats : Form
{
string conString = ConString.conString;
public PartsStats()
{
InitializeComponent();
this.WindowState = FormWindowState.Maximized;
using (DataClasses1DataContext databaseLogs = new DataClasses1DataContext())
{
dataGridView1.DataSource = databaseLogs.Logs.ToList();
}
}
private void showData()
{
DataSet DS = new DataSet();
SqlConnection con = new SqlConnection(conString);
con.Open();
SqlDataAdapter DA = new SqlDataAdapter("SELECT * FROM Parts", con);
DA.Fill(DS, "Parts");
dataGridView1.DataSource = DS.Tables["Parts"];
con.Close();
}
private void PartsStats_Load(object sender, EventArgs e)
{
showData();
this.dataGridView1.Sort(this.timesTakenOutDataGridViewTextBoxColumn, ListSortDirection.Descending);
}
private void PartsStats_FormClosed(object sender, FormClosedEventArgs e)
{
new Admin().Show();
}
}
}