添加设置表格
This commit is contained in:
commit
79340a57d2
2 files changed
+47
-1
No files matched your search
@@ -8,7 +8,18 @@
|
|||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
Title="ProcessManage" Height="450" Width="800" >
|
Title="ProcessManage" Height="450" Width="800" >
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBox x:Name="Datalog" Margin="30,30,300,30" IsReadOnly="True" VerticalScrollBarVisibility="Visible" />
|
<Grid Margin="30,30,300,30" >
|
||||||
|
<TextBox x:Name="Datalog" IsReadOnly="True" VerticalScrollBarVisibility="Visible" />
|
||||||
|
<DataGrid x:Name="data_Grid" FontSize="15" Visibility="Collapsed" />
|
||||||
|
</Grid>
|
||||||
|
<Button Content="染料" HorizontalAlignment="Right" Height="20" Margin="0,0,20,90" VerticalAlignment="Bottom" Width="100"
|
||||||
|
Click="Button_Click_1"/>
|
||||||
|
<Button Content="流程" HorizontalAlignment="Right" Height="20" Margin="0,0,20,60" VerticalAlignment="Bottom" Width="100"
|
||||||
|
Click="Button_Click_2"/>
|
||||||
|
<Button Content="储存" HorizontalAlignment="Right" Height="20" Margin="0,0,20,30" VerticalAlignment="Bottom" Width="100"
|
||||||
|
Click="Button_Click_3"/>
|
||||||
|
<TextBox HorizontalAlignment="Right" Height="20" Margin="0,10,20,130" TextWrapping="NoWrap" VerticalAlignment="Bottom" Width="250"
|
||||||
|
FontSize="14" x:Name="inf"/>
|
||||||
<Grid Margin="0,30,0,0" Width="300" HorizontalAlignment="Right" Height="220" VerticalAlignment="Top" Background="#FFE4E4E4">
|
<Grid Margin="0,30,0,0" Width="300" HorizontalAlignment="Right" Height="220" VerticalAlignment="Top" Background="#FFE4E4E4">
|
||||||
<TextBox HorizontalAlignment="Right" Height="20" Margin="0,10,20,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="200"
|
<TextBox HorizontalAlignment="Right" Height="20" Margin="0,10,20,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="200"
|
||||||
FontSize="14" x:Name="IP"/>
|
FontSize="14" x:Name="IP"/>
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ namespace ProcessManageUI
|
|||||||
private static readonly int _intervalMs = int.Parse(Configini.IniReadvalue("SQL_SERVER", "SQL6"));
|
private static readonly int _intervalMs = int.Parse(Configini.IniReadvalue("SQL_SERVER", "SQL6"));
|
||||||
private static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
private static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||||
private readonly static string DBAddress = Environment.CurrentDirectory + "\\ProcessManage.db"; //数据库路径
|
private readonly static string DBAddress = Environment.CurrentDirectory + "\\ProcessManage.db"; //数据库路径
|
||||||
|
private int DATAGRID_TABLE;
|
||||||
|
|
||||||
//设置定时器
|
//设置定时器
|
||||||
DispatcherTimer disTimer = new DispatcherTimer
|
DispatcherTimer disTimer = new DispatcherTimer
|
||||||
@@ -166,6 +167,40 @@ namespace ProcessManageUI
|
|||||||
Configini.IniWritevalue("SQL_SERVER", "SQL4", USER.Text);
|
Configini.IniWritevalue("SQL_SERVER", "SQL4", USER.Text);
|
||||||
Configini.IniWritevalue("SQL_SERVER", "SQL5", PAW.Text);
|
Configini.IniWritevalue("SQL_SERVER", "SQL5", PAW.Text);
|
||||||
Configini.IniWritevalue("SQL_SERVER", "SQL6", TIMEMS.Text);
|
Configini.IniWritevalue("SQL_SERVER", "SQL6", TIMEMS.Text);
|
||||||
|
inf.Text = "数据库设定已储存";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click_1(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
disTimer.Stop();//停止计时
|
||||||
|
data_Grid.ItemsSource = Product.DefaultView;
|
||||||
|
DATAGRID_TABLE = 1;
|
||||||
|
inf.Text = "设定染料信息";
|
||||||
|
data_Grid.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click_2(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
disTimer.Stop();//停止计时
|
||||||
|
data_Grid.ItemsSource = Gram.DefaultView;
|
||||||
|
DATAGRID_TABLE = 2;
|
||||||
|
inf.Text = "设定流程信息";
|
||||||
|
data_Grid.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click_3(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (DATAGRID_TABLE == 1)
|
||||||
|
{
|
||||||
|
inf.Text = "染料信息已储存";
|
||||||
|
}
|
||||||
|
else if (DATAGRID_TABLE == 2)
|
||||||
|
{
|
||||||
|
inf.Text = "流程信息已储存";
|
||||||
|
}
|
||||||
|
|
||||||
|
data_Grid.Visibility=Visibility.Collapsed;
|
||||||
|
disTimer.Start();//计时
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user