diff --git a/ConvertMoels/ColorSQLConvert.cs b/ConvertMoels/ColorSQLConvert.cs new file mode 100644 index 0000000..e00a27d --- /dev/null +++ b/ConvertMoels/ColorSQLConvert.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace formula_manage.ConvertMoels +{ + internal class ColorSQLConvert + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null) + { + string colorValue = string.Format("{0:X6}", value);//十进制RGB数值转十六进制六位RGB并补0位例“C0C0C0” + /*string StuffColor = "#FF" + colorValue;//RGB数值拼接为ARGB数值(正向)*/ + string StuffColor_B = colorValue.Substring(0, 2);//获取蓝色参数 + string StuffColor_G = colorValue.Substring(2, 2);//获取绿色参数 + string StuffColor_R = colorValue.Substring(4, 2);//获取红色参数 + string StuffColor = "#FF" + StuffColor_R + StuffColor_G + StuffColor_B;//RGB数值拼接为ARGB数值 + return StuffColor;//返回RGB数值例“#FFC0C0C0” + } + else + { + return null;//返回空 + } + } + /// + /// + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return null; + } + } +} diff --git a/ConvertMoels/ProductTypeSQLConvert.cs b/ConvertMoels/ProductTypeSQLConvert.cs new file mode 100644 index 0000000..2e8eee5 --- /dev/null +++ b/ConvertMoels/ProductTypeSQLConvert.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace formula_manage.ConvertMoels +{ + internal class ProductTypeSQLConvert + { + /// + /// + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + string ProductType = System.Convert.ToString(value); + if (ProductType == "0")//类型0:染料,1:助剂,2:粉体助剂,3:液体染料,其它:未知 + { + return "染料"; + } + else + { + if (ProductType == "1") + { + return "助剂"; + } + else + { + if (ProductType == "2") + { + return "粉体助剂"; + } + else + { + if (ProductType == "3") + { + return "液体染料"; + } + else + { + return "未知类型"; + } + } + } + } + } + /// + /// + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return null; + } + } +} diff --git a/MainWindow.xaml b/MainWindow.xaml index 1a21f15..2697e3c 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -19,7 +19,7 @@ - + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 00fb464..02490b4 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -31,6 +31,12 @@ namespace formula_manage help_page.ShowDialog();//实例化并置顶打开信息窗口 } + private void STUFF(object sender, RoutedEventArgs e) + { + Windows.Stuff stuff = new Windows.Stuff(); + stuff.ShowDialog();//实例化并置顶打开设置窗口 + } + private void print(object sender, RoutedEventArgs e) { diff --git a/Windows/Stuff.xaml b/Windows/Stuff.xaml new file mode 100644 index 0000000..4c38cdc --- /dev/null +++ b/Windows/Stuff.xaml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Windows/Stuff.xaml.cs b/Windows/Stuff.xaml.cs new file mode 100644 index 0000000..dc6bba1 --- /dev/null +++ b/Windows/Stuff.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +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.Shapes; + +namespace formula_manage.Windows +{ + /// + /// Stuff.xaml 的交互逻辑 + /// + public partial class Stuff : Window + { + public Stuff() + { + InitializeComponent(); + } + } +} diff --git a/formula_manage.csproj b/formula_manage.csproj index f18e431..6a13c53 100644 --- a/formula_manage.csproj +++ b/formula_manage.csproj @@ -55,6 +55,11 @@ MSBuild:Compile Designer + + + + Stuff.xaml + Designer MSBuild:Compile @@ -74,6 +79,10 @@ MainWindow.xaml Code + + Designer + MSBuild:Compile + @@ -104,8 +113,6 @@ - - - + \ No newline at end of file