diff --git a/View/StuffView.xaml b/View/StuffView.xaml
index bc69dfb..7ae332f 100644
--- a/View/StuffView.xaml
+++ b/View/StuffView.xaml
@@ -55,7 +55,7 @@
-
+
@@ -72,8 +72,8 @@
-
-
+
+
@@ -94,11 +94,11 @@
-
+
-
+
-
+
diff --git a/View/StuffView.xaml.cs b/View/StuffView.xaml.cs
index 9599b2b..543ed13 100644
--- a/View/StuffView.xaml.cs
+++ b/View/StuffView.xaml.cs
@@ -14,6 +14,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Forms;
using System.Drawing;
+using System.Text.RegularExpressions;
namespace Audit.View
{
@@ -30,9 +31,28 @@ namespace Audit.View
InitializeComponent();
}
- private void Button_Preservation(object sender, RoutedEventArgs e)
+ ///
+ /// 输入限制
+ /// 仅允许数字及小数点
+ ///
+ public void Limitnumber(object sender, TextCompositionEventArgs e)
{
+ Regex re = new Regex("[^0-9]+.");//实例化输入信息白名单
+ e.Handled = re.IsMatch(e.Text);//检查输入信息并匹配白名单
+
+ }
+ private void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件
+ {
+ if (string.IsNullOrWhiteSpace(this.stuff_ProductCode.Text)) System.Windows.MessageBox.Show("ERR.C0101-1:无效的原料信息");//检查原料代码
+ else
+ if (string.IsNullOrWhiteSpace(this.stuff_ProductName.Text)) System.Windows.MessageBox.Show("ERR.C0101-2:无效的原料信息");//检查原料名称
+ else
+ if (string.IsNullOrWhiteSpace(this.stuff_ProductType.Text)) System.Windows.MessageBox.Show("ERR.C0101-3:无效的原料信息");//检查原料类型
+ else
+ {
+
+ }
}
private void Button_Delete(object sender, RoutedEventArgs e)
@@ -40,10 +60,10 @@ namespace Audit.View
}
- private void DataGridStuff_MouseDoubleClick(object sender, MouseButtonEventArgs e)
+ private void DataGridStuff_MouseDoubleClick(object sender, MouseButtonEventArgs e)//数据表双击事件
{
int rownum = DataGridStuff.SelectedIndex;//获取鼠标选中行并定义变量
- if (rownum != -1)
+ if (rownum != -1)//判断鼠标定位是否有效
{
string DataGridStuff_ProductCode = (DataGridStuff.Columns[1].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,原料代码
string DataGridStuff_ProductName = (DataGridStuff.Columns[2].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第1列选中行单元格,原料名称
@@ -77,8 +97,13 @@ namespace Audit.View
}
+ ///
+ ///存储色彩变量
+ ///
+ public static int ColorCode_SQL;
private void Stuff_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)//打开调色盘
{
@@ -89,11 +114,8 @@ namespace Audit.View
stuff_Color.Foreground = new SolidColorBrush(MColor);//ARGB参数输出至stuff_Color的前景色
string colorCode = Convert.ToString(DColor.B,16) + Convert.ToString(DColor.G,16) + Convert.ToString(DColor.R,16);//反向十六进制RGB
//string colorCode = Convert.ToString(DColor.R,16) + Convert.ToString(DColor.G,16) + Convert.ToString(DColor.B,16);//正向十六进制RGB
- int ColorCode_SQL = Convert.ToInt32(colorCode, 16);//十六进制RGB转存储数值
-
+ ColorCode_SQL = Convert.ToInt32(colorCode, 16);//十六进制RGB转存储数值 //
}
-
-
}
}
}
diff --git a/Windows/LogWindow.xaml.cs b/Windows/LogWindow.xaml.cs
index 9662340..5be248a 100644
--- a/Windows/LogWindow.xaml.cs
+++ b/Windows/LogWindow.xaml.cs
@@ -75,7 +75,7 @@ namespace Audit.Windows
}
else
{
- MessageBox.Show("ERR.C0011:拒绝登录");//设置密码错误
+ MessageBox.Show("ERR.C0001:拒绝登录");//设置密码错误
}
}