16 changed files with 511 additions and 23 deletions
@ -0,0 +1,118 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Data; |
||||
|
using System.IO; |
||||
|
|
||||
|
namespace SunlightAggregationManager.UserClass |
||||
|
{ |
||||
|
public class LogGing |
||||
|
{ |
||||
|
public static void LogGingDATA(string dat) |
||||
|
{ |
||||
|
string logpath = System.Environment.CurrentDirectory + "\\Log";//日志文件目录
|
||||
|
string logPath = "" + System.Environment.CurrentDirectory + "\\Log\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt";//日志文件
|
||||
|
string Log_time = "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]:"; |
||||
|
|
||||
|
if (Directory.Exists(logpath))//检查日志路径
|
||||
|
{ |
||||
|
if (!File.Exists(logPath))//检查日志文件并写入启动日志
|
||||
|
{ |
||||
|
FileStream fs = new FileStream(logPath, FileMode.CreateNew, FileAccess.Write);//创建写入文件
|
||||
|
StreamWriter wr = new StreamWriter(fs);//创建文件
|
||||
|
wr.WriteLine(Log_time + dat); |
||||
|
wr.Close(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
FileStream fs = new FileStream(logPath, FileMode.Append, FileAccess.Write); |
||||
|
StreamWriter wr = new StreamWriter(fs);//创建文件
|
||||
|
wr.WriteLine(Log_time + dat); |
||||
|
wr.Close(); |
||||
|
} |
||||
|
catch { } |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
DirectoryInfo directoryInfo = new DirectoryInfo(logpath); |
||||
|
directoryInfo.Create();//创建日志路径
|
||||
|
} |
||||
|
} |
||||
|
public static void ERRDATA(System.Exception dat) |
||||
|
{ |
||||
|
string Log_time = DateTime.Now.ToString("yyyy-MM-dd"); |
||||
|
string logpath = System.Environment.CurrentDirectory + "\\ERR";//日志文件目录
|
||||
|
// string logPathtxt = "" + System.Environment.CurrentDirectory + "\\Log\\"+ Log_time + "Log.txt";//日志文件
|
||||
|
// System.IO.DirectoryInfo log = new System.IO.DirectoryInfo();//生成日志文件目录
|
||||
|
string log_path = logpath + "\\ERR" + Log_time + ".txt"; |
||||
|
string Log_timehms = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
||||
|
if (Directory.Exists(logpath))//检查日志路径
|
||||
|
{ |
||||
|
if (!File.Exists(log_path))//检查文件并写入
|
||||
|
{ |
||||
|
// FileStream fs = new FileStream(log_path, FileMode.CreateNew, FileAccess.Write);//创建文件
|
||||
|
// StreamWriter wr = new StreamWriter(fs);//创建文件
|
||||
|
// wr.Close();
|
||||
|
FileStream fil = new FileStream(log_path, FileMode.CreateNew, FileAccess.Write);//创建写入文件
|
||||
|
StreamWriter wfil = new StreamWriter(fil);//创建文件
|
||||
|
wfil.WriteLine("[" + Log_timehms + "];[Error] ||" + Environment.NewLine.ToString()); |
||||
|
wfil.WriteLine("[" + Log_timehms + "];[Error source] ||" + dat.Source.ToString() + Environment.NewLine.ToString()); |
||||
|
wfil.WriteLine("[" + Log_timehms + "];[Error message] ||" + dat.Message.ToString() + Environment.NewLine.ToString()); |
||||
|
wfil.WriteLine("[" + Log_timehms + "];[Error area] ||" + dat.StackTrace.ToString()); |
||||
|
wfil.Close(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
FileStream fs = new FileStream(log_path, FileMode.Append, FileAccess.Write);//创建写入文件
|
||||
|
StreamWriter wr = new StreamWriter(fs);//创建文件
|
||||
|
wr.WriteLine("[" + Log_timehms + "];[Error] ||" + Environment.NewLine.ToString()); |
||||
|
wr.WriteLine("[" + Log_timehms + "];[Error source] ||" + dat.ToString() + Environment.NewLine.ToString()); |
||||
|
wr.WriteLine("[" + Log_timehms + "];[Error message] ||" + dat.Message.ToString() + Environment.NewLine.ToString()); |
||||
|
wr.WriteLine("[" + Log_timehms + "];[Error area] ||" + dat.ToString()); |
||||
|
wr.Close(); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
DirectoryInfo directoryInfo = new DirectoryInfo(logpath); |
||||
|
directoryInfo.Create(); |
||||
|
} |
||||
|
} |
||||
|
public static void ExchangeDATA(string dat) |
||||
|
{ |
||||
|
string Log_time = DateTime.Now.ToString("yyyy-MM-dd"); |
||||
|
string logpath = System.Environment.CurrentDirectory + "\\Exchange";//日志文件目录
|
||||
|
// string logPathtxt = "" + System.Environment.CurrentDirectory + "\\Log\\"+ Log_time + "Log.txt";//日志文件
|
||||
|
// System.IO.DirectoryInfo log = new System.IO.DirectoryInfo();//生成日志文件目录
|
||||
|
string log_path = logpath + "\\Exchange" + Log_time + ".txt"; |
||||
|
string Log_timehms = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
||||
|
if (Directory.Exists(logpath))//检查日志路径
|
||||
|
{ |
||||
|
if (!File.Exists(log_path))//检查文件并写入
|
||||
|
{ |
||||
|
// FileStream fs = new FileStream(log_path, FileMode.CreateNew, FileAccess.Write);//创建文件
|
||||
|
// StreamWriter wr = new StreamWriter(fs);//创建文件
|
||||
|
// wr.Close();
|
||||
|
FileStream fil = new FileStream(log_path, FileMode.CreateNew, FileAccess.Write);//创建写入文件
|
||||
|
StreamWriter wfil = new StreamWriter(fil);//创建文件
|
||||
|
wfil.WriteLine("[" + Log_timehms + "];[Exchange] ||" + dat); |
||||
|
wfil.Close(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
FileStream fs = new FileStream(log_path, FileMode.Append, FileAccess.Write);//创建写入文件
|
||||
|
StreamWriter wr = new StreamWriter(fs);//创建文件
|
||||
|
wr.WriteLine("[" + Log_timehms + "];[Exchange] ||" + dat); |
||||
|
wr.Close(); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
DirectoryInfo directoryInfo = new DirectoryInfo(logpath); |
||||
|
directoryInfo.Create(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,126 @@ |
|||||
|
<Window x:Class="SunlightAggregationManager.UserWindow.User" |
||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
|
xmlns:local="clr-namespace:SunlightAggregationManager.UserWindow" |
||||
|
xmlns:viewmodel="clr-namespace:SunlightAggregationManager.ViewModel" |
||||
|
xmlns:lang="clr-namespace:SunlightAggregationManager" |
||||
|
mc:Ignorable="d" |
||||
|
Loaded="user_Loaded" |
||||
|
ResizeMode="NoResize" |
||||
|
Title="MAC_SET" |
||||
|
Height="900" Width="1440" MinHeight="900" MinWidth="1440" |
||||
|
BorderBrush="White" Background="White"> |
||||
|
<Grid> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition Height="5"/> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition Height="100"/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" Background="#FFCECECE"/> |
||||
|
<Grid Grid.Row="0"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition MinWidth="200" MaxWidth="500"/> |
||||
|
<ColumnDefinition Width="5"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch" Background="#FFCECECE"/> |
||||
|
<Grid Grid.Column="0"> |
||||
|
<!--用户--> |
||||
|
<TextBox x:Name="_User" Height="30" Margin="105,10,10,100" VerticalAlignment="Top" FontSize="16" MaxLines="1" InputMethod.IsInputMethodEnabled="False" /> |
||||
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,10,0,100" TextWrapping="Wrap" |
||||
|
Text="{x:Static lang:ResourceLanguage.user}" VerticalAlignment="Top" Width="85" FontSize="20"/> |
||||
|
<!--名--> |
||||
|
<TextBox x:Name="_Name" Height="30" Margin="105,55,10,100" VerticalAlignment="Top" FontSize="16" MaxLines="1" /> |
||||
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,55,0,100" TextWrapping="Wrap" |
||||
|
Text="{x:Static lang:ResourceLanguage.Name}" VerticalAlignment="Top" Width="85" FontSize="20"/> |
||||
|
<!--密码--> |
||||
|
<TextBox x:Name="Pasword" Height="30" Margin="105,100,10,50" VerticalAlignment="Top" FontSize="16" MaxLines="1" InputMethod.IsInputMethodEnabled="False" /> |
||||
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,100,0,50" TextWrapping="Wrap" |
||||
|
Text="{x:Static lang:ResourceLanguage.Password}" VerticalAlignment="Top" Width="80" FontSize="20"/> |
||||
|
<!--部门--> |
||||
|
<TextBox x:Name="_Department" Height="30" Margin="105,145,10,50" VerticalAlignment="Top" FontSize="16" MaxLines="1" /> |
||||
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,145,0,50" TextWrapping="Wrap" |
||||
|
Text="{x:Static lang:ResourceLanguage.Department}" VerticalAlignment="Top" Width="80" FontSize="20"/> |
||||
|
<!--组--> |
||||
|
<ComboBox x:Name="GROUP" Height="30" Margin="105,190,10,100" VerticalAlignment="Top" FontSize="16" IsReadOnly="True"> |
||||
|
<ComboBoxItem Content="CHIEF"></ComboBoxItem> |
||||
|
<ComboBoxItem Content="ENGINEER"></ComboBoxItem> |
||||
|
<ComboBoxItem Content="POWERUSER"></ComboBoxItem> |
||||
|
<ComboBoxItem Content="USER"></ComboBoxItem> |
||||
|
</ComboBox> |
||||
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,190,0,50" TextWrapping="Wrap" |
||||
|
Text="{x:Static lang:ResourceLanguage.Groups}" VerticalAlignment="Top" Width="80" FontSize="20"/> |
||||
|
</Grid> |
||||
|
<Grid Grid.Column="2" Margin="0"> |
||||
|
<ScrollViewer Margin="0" VerticalScrollBarVisibility="Auto"> |
||||
|
<WrapPanel Orientation="Horizontal" x:Name="Capacity" > |
||||
|
</WrapPanel> |
||||
|
</ScrollViewer> |
||||
|
</Grid> |
||||
|
</Grid> |
||||
|
<!--表--> |
||||
|
<DataGrid Grid.Row="2" x:Name="DataGriduser" MouseDoubleClick="DataGridMac_MouseDoubleClick" SelectionMode="Single" AlternationCount="2" IsReadOnly="True" |
||||
|
d:ItemsSource="{d:SampleData ItemCount=999}" AutoGenerateColumns="False" MinColumnWidth="30" |
||||
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="{x:Null}" |
||||
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" |
||||
|
CanUserResizeRows="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" |
||||
|
CanUserResizeColumns="False" CanUserSortColumns="False" HeadersVisibility ="Column" Background="{x:Null}"> |
||||
|
<DataGrid.RowStyle > |
||||
|
<Style TargetType="{x:Type DataGridRow}"> |
||||
|
<Style.Triggers> |
||||
|
<Trigger Property="ItemsControl.AlternationIndex" Value="0"> |
||||
|
<Setter Property="Background" Value="#FFFFFFFF" /> |
||||
|
</Trigger> |
||||
|
<Trigger Property="ItemsControl.AlternationIndex" Value="1"> |
||||
|
<Setter Property="Background" Value="#FFF0F0F0" /> |
||||
|
</Trigger> |
||||
|
<Trigger Property="IsMouseOver" Value="False"> |
||||
|
</Trigger> |
||||
|
</Style.Triggers> |
||||
|
</Style> |
||||
|
</DataGrid.RowStyle> |
||||
|
<DataGrid.CellStyle> |
||||
|
<Style TargetType="DataGridCell"> |
||||
|
<Setter Property="BorderThickness" Value="0"/> |
||||
|
<Setter Property="MinWidth" Value="20"/> |
||||
|
<Style.Triggers> |
||||
|
<Trigger Property="IsSelected" Value="True"> |
||||
|
<Setter Property="Background" Value="#FFC0C0C0"/> |
||||
|
<Setter Property="BorderBrush" Value="#FFC0C0C0"/> |
||||
|
<Setter Property="Foreground" Value="#000000"/> |
||||
|
</Trigger> |
||||
|
</Style.Triggers> |
||||
|
</Style> |
||||
|
</DataGrid.CellStyle> |
||||
|
<DataGrid.Columns> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.user}" Binding="{Binding User}" |
||||
|
Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.Name}" Binding="{Binding Name}" |
||||
|
Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.Password}" Binding="{Binding Password}" |
||||
|
Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.Department}" Binding="{Binding Department}" |
||||
|
Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.Groups}" Binding="{Binding Groups}" |
||||
|
Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Binding="{Binding Capacity}" Width="0" MaxWidth="0" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.LastLoginIP}" Binding="{Binding LastLoginIP}" |
||||
|
Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
||||
|
<DataGridTextColumn Header="{x:Static lang:ResourceLanguage.LastLoginTime}" Binding="{Binding LastLoginTime}" |
||||
|
Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/> |
||||
|
|
||||
|
</DataGrid.Columns> |
||||
|
</DataGrid> |
||||
|
<!--存储按钮--> |
||||
|
<Button Grid.Row="3" Content="存储" HorizontalAlignment="Right" Height="50" VerticalAlignment="Center" Width="100" FontSize="30" |
||||
|
Click="Button_Preservation" Margin="0,0,200,0"> |
||||
|
</Button> |
||||
|
<!--删除按钮--> |
||||
|
<Button Grid.Row="3" Content="删除" HorizontalAlignment="Right" Height="50" VerticalAlignment="Center" Width="100" FontSize="30" |
||||
|
Click="Button_Delete" Margin="0,0,50,0"> |
||||
|
</Button> |
||||
|
</Grid> |
||||
|
</Window> |
||||
@ -0,0 +1,152 @@ |
|||||
|
using SunlightAggregationManager.View; |
||||
|
using SunlightAggregationManager.ViewModel; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Data; |
||||
|
using System.Data.SqlClient; |
||||
|
using System.Text.RegularExpressions; |
||||
|
using System.Windows; |
||||
|
using System.Windows.Controls; |
||||
|
using System.Windows.Input; |
||||
|
using System.Xml.Linq; |
||||
|
|
||||
|
namespace SunlightAggregationManager.UserWindow |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Machine.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class User : Window |
||||
|
{ |
||||
|
CheckBox[] checkBoxes = new CheckBox[99]; |
||||
|
string[] strings = new string[8] {"修改系统设置", "修改用户设置", |
||||
|
"设备监控","设备控制","远程设置","远程查询","输送信息","历史查询"}; |
||||
|
public User() |
||||
|
{ |
||||
|
WindowStartupLocation = WindowStartupLocation.CenterScreen; |
||||
|
InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
private void user_Loaded(object sender, RoutedEventArgs e)//打开页面执行
|
||||
|
{ |
||||
|
for (int i = 0; i < strings.Length; i++) |
||||
|
{ |
||||
|
checkBoxes[i] = new CheckBox(); |
||||
|
checkBoxes[i].Content = strings[i].ToString(); |
||||
|
checkBoxes[i].FontSize = 20; |
||||
|
checkBoxes[i].Width = 200; |
||||
|
checkBoxes[i].Height = 50; |
||||
|
Capacity.Children.Add(checkBoxes[i]); |
||||
|
} |
||||
|
DataGriduser.ItemsSource = MainWindowViewModel._userData.DefaultView; |
||||
|
} |
||||
|
|
||||
|
private void Tb_KeyFloating(object sender, TextCompositionEventArgs e)//输入事件
|
||||
|
{ |
||||
|
//Regex re = new Regex("[^0-9.-]+");
|
||||
|
Regex re = new Regex(@"^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$");// 非负浮点数
|
||||
|
e.Handled = !re.IsMatch(e.Text); |
||||
|
} |
||||
|
|
||||
|
private void DataGridMac_MouseDoubleClick(object sender, MouseButtonEventArgs e)//数据表双击事件
|
||||
|
{ |
||||
|
string Capacity_; |
||||
|
int rownum = DataGriduser.SelectedIndex;//获取鼠标选中行并定义变量
|
||||
|
if (rownum != -1)//判断鼠标定位是否有效
|
||||
|
{ |
||||
|
/*定位选中行及指定列单元格文本信息*/ |
||||
|
_Name.Text = (DataGriduser.Columns[1].GetCellContent(DataGriduser.Items[rownum]) as TextBlock)!.Text.Trim();//定位第列
|
||||
|
_User.Text = (DataGriduser.Columns[0].GetCellContent(DataGriduser.Items[rownum]) as TextBlock)!.Text.Trim();//定位第列
|
||||
|
GROUP.Text = (DataGriduser.Columns[4].GetCellContent(DataGriduser.Items[rownum]) as TextBlock)!.Text.Trim(); |
||||
|
Capacity_ = (DataGriduser.Columns[5].GetCellContent(DataGriduser.Items[rownum]) as TextBlock)!.Text.Trim(); |
||||
|
_Department.Text = (DataGriduser.Columns[3].GetCellContent(DataGriduser.Items[rownum]) as TextBlock)!.Text.Trim(); |
||||
|
Pasword.Text = (DataGriduser.Columns[2].GetCellContent(DataGriduser.Items[rownum]) as TextBlock)!.Text.Trim(); |
||||
|
|
||||
|
if (strings.Length > Capacity_.Length) |
||||
|
{ |
||||
|
for (int i = 0; i < Capacity_.Length; i++) |
||||
|
{ |
||||
|
if (Capacity_.Substring(i, 1) == "1") |
||||
|
{ |
||||
|
checkBoxes[i].IsChecked = true; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
checkBoxes[i].IsChecked = false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
for (int i = 0; i < strings.Length; i++) |
||||
|
{ |
||||
|
if (Capacity_.Substring(i, 1) == "1") |
||||
|
{ |
||||
|
checkBoxes[i].IsChecked = true; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
checkBoxes[i].IsChecked = false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件
|
||||
|
{ |
||||
|
Regex re_number = new Regex(@"^[0-9]+(.[0-9]{1,2})?$");//校验用正则表达式有1~2位小数的正实数
|
||||
|
Regex re_char = new Regex(@"^[A-Za-z0-9\s@()()/+!!_-]+$");//校验用正则表达式由数字,26个英文字母,空白字符和@()()/+!!_-组成的字符串
|
||||
|
|
||||
|
string user = _User.Text; |
||||
|
string name = _Name.Text; |
||||
|
string password = Pasword.Text; |
||||
|
string Group = GROUP.Text; |
||||
|
string Cap = ""; |
||||
|
string department = _Department.Text; |
||||
|
for (int i = 0; i < strings.Length; i++) |
||||
|
{ |
||||
|
if ((bool)checkBoxes[i].IsChecked!) |
||||
|
{ |
||||
|
Cap = Cap + "1"; |
||||
|
} |
||||
|
else { Cap = Cap + "0"; } |
||||
|
} |
||||
|
Dictionary<string, object> USER_new = new Dictionary<string, object>();//缓存函数
|
||||
|
USER_new.Add("User", user); |
||||
|
USER_new.Add("Name", name); |
||||
|
USER_new.Add("Password", password); |
||||
|
USER_new.Add("Groups", Group); |
||||
|
USER_new.Add("Capacity", Cap); |
||||
|
USER_new.Add("Department", department); |
||||
|
USER_new.Add("State", 0); |
||||
|
USER_new.Add("Enterprise", MainWindowViewModel.Enterprise); |
||||
|
|
||||
|
var rowdata = MainWindowViewModel.Selet_Memory(MainWindowViewModel._userData, "UserID", "User='" + user + "'"); |
||||
|
if (rowdata != null) |
||||
|
{ |
||||
|
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" + user + "'", USER_new); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
MainWindowViewModel.Insert_Memory(MainWindowViewModel._userData, USER_new);// 执行插入
|
||||
|
} |
||||
|
DataGriduser.ItemsSource = MainWindowViewModel._userData.DefaultView; |
||||
|
_Name.Text = null; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private void Button_Delete(object sender, RoutedEventArgs e)//删除按钮事件
|
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
MainWindowViewModel.Delete_Memory(MainWindowViewModel._userData, "User='" + _User.Text + "'"); |
||||
|
} |
||||
|
catch (Exception) { } |
||||
|
finally |
||||
|
{ |
||||
|
DataGriduser.ItemsSource = MainWindowViewModel._userData.DefaultView; |
||||
|
_Name.Text = null; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
<UserControl x:Class="SunlightAggregationManager.View.ExtendPage" |
||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
|
xmlns:local="clr-namespace:SunlightAggregationManager.View" |
||||
|
mc:Ignorable="d" |
||||
|
d:DesignHeight="450" d:DesignWidth="800"> |
||||
|
<Grid> |
||||
|
|
||||
|
</Grid> |
||||
|
</UserControl> |
||||
@ -0,0 +1,26 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using System.Windows; |
||||
|
using System.Windows.Controls; |
||||
|
using System.Windows.Data; |
||||
|
using System.Windows.Documents; |
||||
|
using System.Windows.Input; |
||||
|
using System.Windows.Media; |
||||
|
using System.Windows.Media.Imaging; |
||||
|
using System.Windows.Navigation; |
||||
|
using System.Windows.Shapes; |
||||
|
|
||||
|
namespace SunlightAggregationManager.View |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// ExtendPage.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class ExtendPage : UserControl |
||||
|
{ |
||||
|
public ExtendPage() |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue