-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddTable.xaml.cs
More file actions
45 lines (41 loc) · 1.33 KB
/
AddTable.xaml.cs
File metadata and controls
45 lines (41 loc) · 1.33 KB
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
using System;
using System.Windows;
using System.Windows.Input;
namespace TheGUIAndSQLApp
{
/// <summary>
/// Логика взаимодействия для AddTable.xaml
/// </summary>
public partial class AddTable
{
private string currentDB;
private string connectString;
public AddTable(string cDB, string connStr)
{
InitializeComponent();
currentDB = cDB;
connectString = connStr;
}
private void columnsNumber_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
if (!Char.IsDigit(e.Text, 0)) e.Handled = true;
}
private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (App.Current.MainWindow != null)
{
App.Current.MainWindow.IsEnabled = true;
App.Current.MainWindow.Activate();
}
}
private void Button_Click(object sender, RoutedEventArgs e)
{
int columnsNumberI;
int.TryParse(columnsNumber.Text, out columnsNumberI);
CreateTable create = new CreateTable(tableName.Text, connectString, currentDB, columnsNumberI);
create.Owner = this.Owner;
create.Show();
this.Close();
}
}
}