-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServerPicker.cs
111 lines (90 loc) · 3.17 KB
/
ServerPicker.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AntiIniUI.DataLayer;
using System.Collections.ObjectModel;
namespace Databáze_II_Projekt
{
public partial class SpravceHracu : Form
{
Collection<Server> h = new Collection<Server>();
public SpravceHracu()
{
InitializeComponent();
Table();
}
private void Table()
{
this.dataGridViewBugy.AllowUserToAddRows = true;
h = DataConnection.GetServers();
this.dataGridViewBugy.Rows.Clear();
#region Inicializace tabulky
for (int i = 0; i < this.dataGridViewBugy.Rows.Count; i++)
{
if (i < h.Count)
{
this.dataGridViewBugy.Rows.Add();
}
else
{
this.dataGridViewBugy.AllowUserToAddRows = false;
break;
}
this.dataGridViewBugy.Rows[i].Cells[0].Value = h[i].ServerName;
this.dataGridViewBugy.Rows[i].Cells[1].Value = h[i].ConnectionArgument;
}
this.dataGridViewBugy.Refresh();
#endregion
}
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void dataGridViewBugy_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
//if (e.ColumnIndex == 3)
//{
// int id = -1;
// string prezdivka = this.dataGridViewBugy.Rows[e.RowIndex].Cells[0].Value.ToString();
// var h_id = prezdivka.Split('#');
// id = int.Parse(h_id[1]);
// Server.Update(new Hraci()
// {
// Hrac_id = id,
// Prezdivka = this.textBox2.Text,
// Steam_id = int.Parse(this.textBox3.Text),
// Discord_id = int.Parse(this.textBox4.Text)
// });
//}
//else if (e.ColumnIndex == 4)
//{
// int id = -1;
// string prezdivka = this.dataGridViewBugy.Rows[e.RowIndex].Cells[0].Value.ToString();
// var h_id = prezdivka.Split('#');
// id = int.Parse(h_id[1]);
// HraciTable.Delete(id);
//}
//Table();
}
private void textBoxName_TextChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void buttonBAN_Click(object sender, EventArgs e)
{
//HraciTable.Insert(new Hraci()
//{
// Prezdivka = this.textBoxName.Text,
// Steam_id = int.Parse(this.textBoxStart.Text),
// Discord_id = int.Parse(this.textBoxKonec.Text)
//});
//Table();
}
}
}