Browse Source

用户管理修改

master
sc 7 months ago
parent
commit
083278d7bf
  1. 2
      View/DyeingPlanView.xaml
  2. 34
      View/DyeingPlanView.xaml.cs
  3. 4
      WindowsView/User.xaml.cs

2
View/DyeingPlanView.xaml

@ -10,7 +10,7 @@
d:DesignHeight="900" d:DesignWidth="1100">
<Grid Background="White" Cursor="">
<ComboBox HorizontalAlignment="Left" Height="30" Margin="140,30,10,0" x:Name="comboBoxWorkOrder" VerticalAlignment="Top" Width="270"
FontSize="15" IsEditable="True" BorderBrush="#FF673AB7" DropDownClosed="comboBoxMachine_DropDownClosed" />
FontSize="15" IsEditable="True" BorderBrush="#FF673AB7" DropDownClosed="comboBoxMachine_DropDownClosed" KeyDown="comboBoxWorkOrder_KeyDown"/>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,30,280,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.orders}"
VerticalAlignment="Top" Width="120" FontSize="25"/>
<ComboBox HorizontalAlignment="Left" Height="30" Margin="140,80,10,0" x:Name="comboBoxDyelot" VerticalAlignment="Top" Width="270"

34
View/DyeingPlanView.xaml.cs

@ -278,25 +278,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}//工艺修改事件
private void color_color_MouseDoubleClick(object sender, MouseButtonEventArgs e)//颜色
{
System.Windows.Forms.ColorDialog colorDialog = new System.Windows.Forms.ColorDialog();//使用调色盘控件ColorDialog
if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)//打开调色盘
{
System.Drawing.Color DColor = colorDialog.Color;////获取选中色彩信息
//System.Windows.Media.Color MColor = new System.Windows.Media.Color();//转换
System.Windows.Media.Color MColor = System.Windows.Media.Color.FromArgb(DColor.A, DColor.R, DColor.G, DColor.B);//转换并配置ARGB参数
// color_color.Background = new SolidColorBrush(MColor);//ARGB参数输出至Color的背景色
//string colorCode = string.Format("{0:X2}", DColor.B) + string.Format("{0:X2}", DColor.G) + string.Format("{0:X2}", DColor.R);//反向十六进制RGB
//string colorCode = string.Format("{0:X2}", DColor.R) + string.Format("{0:X2}", DColor.G) + string.Format("{0:X2}", DColor.B);//正向十六进制RGB
//ColorCode_SQL = Convert.ToInt32(colorCode, 16);//十六进制RGB转存储数值
}
}
//string ProgramID;
//string ProgramNAME;
string Numder = null;
string ID = null;
string P1, P2, P3, P4, P5;
@ -390,6 +371,21 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
Grid_data.ItemsSource = dat.DefaultView;
}
private void comboBoxWorkOrder_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
try
{
//do what you want
}
catch (Exception ex)
{
}
}
}
public void Dat()//行号刷新
{
int a = dat.Rows.Count;

4
WindowsView/User.xaml.cs

@ -109,7 +109,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.WindowsView
SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.Delete("USER", "Name='" + name + "'", null);
SQLiteHelpers.InsertData("USER", USER_new);// 执行插入
DataGriduser.ItemsSource = SQLiteHelpers.ExecuteDataSet("select * from USER order by Name desc", null).Tables[0].DefaultView;
SQLiteHelpers.Close();
_Name.Text = null;
}
private void Button_Delete(object sender, RoutedEventArgs e)//删除按钮事件
@ -117,7 +119,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.WindowsView
SQLiteHelpers = new UserClass.SqliteHelper.SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.Delete("USER", "Name='" + _Name.Text + "'", null);
DataGriduser.ItemsSource = SQLiteHelpers.ExecuteDataSet("select * from USER order by Name desc", null).Tables[0].DefaultView;
SQLiteHelpers.Close();
_Name.Text = null;
}
}
}

Loading…
Cancel
Save