Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage
This commit is contained in:
commit
d6e4e0dd60
4 files changed
+196
-40
No files matched your search
+2
-1
@@ -171,7 +171,7 @@
|
||||
Text="{Binding PRODUCT_CODE}" IsTextSearchEnabled="True" StaysOpenOnEdit="True"
|
||||
BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True"
|
||||
KeyDown="CP_PRODUCT_CODE_KeyUp"
|
||||
LostFocus="CP_PRODUCT_CODE_LostFocus">
|
||||
DropDownClosed="CP_PRODUCT_CODE_DropDownClosed">
|
||||
</ComboBox>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
@@ -204,6 +204,7 @@
|
||||
ItemsSource="{Binding stuff_Product, Source={StaticResource MainWindowViewModel}}"
|
||||
DisplayMemberPath="ProductName"
|
||||
Text="{Binding PRODUCT_NAME}"
|
||||
DropDownClosed="CP_PRODUCT_NAME_DropDownClosed"
|
||||
BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True" IsReadOnly="True" Focusable="True" IsTabStop="False"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
|
||||
+186
-38
@@ -131,6 +131,10 @@ namespace formula_manage
|
||||
{
|
||||
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
|
||||
}
|
||||
|
||||
list_Weight.Text = Configini.IniReadvalue("SOFTWARE_SET", "T4"); //自定义
|
||||
list_Proportion.Text = Configini.IniReadvalue("SOFTWARE_SET", "T5"); //自定义
|
||||
list_Total.Text =(double.Parse(list_Proportion.Text)* double.Parse(list_Weight.Text)).ToString();
|
||||
}
|
||||
|
||||
private async void Permissions_()
|
||||
@@ -463,18 +467,45 @@ namespace formula_manage
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
System.Windows.Controls.ComboBox curComboBox = sender as System.Windows.Controls.ComboBox;
|
||||
int grid_row = Grid_RRODUCT.SelectedIndex; //获取当前行
|
||||
|
||||
Code_ = curComboBox.Text;
|
||||
if (Code_ == "") return;
|
||||
if (Code_ == "")
|
||||
{
|
||||
if (Procedures_N.Text == Procedures_P.Text)
|
||||
{
|
||||
MessageBoxResult P = System.Windows.MessageBox.Show("是否保存", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); //提示
|
||||
if (P == MessageBoxResult.Cancel) { }
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxResult P = System.Windows.MessageBox.Show("是否进入下一步", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); //提示
|
||||
if (P == MessageBoxResult.Cancel) return;
|
||||
|
||||
DataRow[] r = MainWindowViewModel.STUFFdatatemp.Select("ProductCode ='" + Code_ + "'");
|
||||
Procedures_P.Text = (int.Parse(Procedures_P.Text) + 1).ToString();
|
||||
PressKey.PressKeys(Keys.Tab, false);
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
return;
|
||||
|
||||
if (!r.Any())
|
||||
}
|
||||
}
|
||||
|
||||
DataRow[] r = MainWindowViewModel.STUFFdatatemp.Select("ProductCode ='" + Code_ + "'"); //查询判断原料代码是否有效
|
||||
if (!r.Any()) //检查原料信息
|
||||
{
|
||||
System.Windows.MessageBox.Show("原料不存在");
|
||||
curComboBox.Text = "";
|
||||
return;
|
||||
}
|
||||
|
||||
DataRow[] c = RRODUCTdataTable.Select("PRODUCT_CODE ='" + Code_ + "'");//查询判断原料代码是否重复
|
||||
if (c.Any())
|
||||
{
|
||||
System.Windows.MessageBox.Show("重复原料");
|
||||
return;
|
||||
}
|
||||
|
||||
Name_ = r[0].ItemArray[1].ToString();
|
||||
Type_ = r[0].ItemArray[2].ToString();
|
||||
Conc_ = r[0].ItemArray[3].ToString();
|
||||
@@ -512,21 +543,31 @@ namespace formula_manage
|
||||
}
|
||||
}
|
||||
|
||||
DataRow row = RRODUCTdataTable.Rows[ID_N-1]; //ID列
|
||||
if (grid_row == -1) grid_row = 0;
|
||||
DataRow row = RRODUCTdataTable.Rows[grid_row]; //ID列
|
||||
row.BeginEdit();
|
||||
row["PRODUCT_CODE"] = Code_;
|
||||
row["PRODUCT_NAME"] = Name_;
|
||||
row["SHIFT"] = Type_;
|
||||
row.EndEdit();
|
||||
|
||||
|
||||
PressKey.PressKeys(Keys.Right, false);
|
||||
PressKey.PressKeys(Keys.Right, true);
|
||||
PressKey.PressKeys(Keys.Tab, false);
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
if (grid_row == (ID_N - 1))
|
||||
{
|
||||
PressKey.PressKeys(Keys.Right, false);
|
||||
PressKey.PressKeys(Keys.Right, true);
|
||||
PressKey.PressKeys(Keys.Tab, false);
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
PressKey.PressKeys(Keys.Right, false);
|
||||
PressKey.PressKeys(Keys.Right, true);
|
||||
PressKey.PressKeys(Keys.Up, false);
|
||||
PressKey.PressKeys(Keys.Up, true);
|
||||
PressKey.PressKeys(Keys.Tab, false);
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
}
|
||||
}
|
||||
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
||||
|
||||
}
|
||||
|
||||
private void CP_CONC_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)//目标饱和度输入事件
|
||||
@@ -535,6 +576,7 @@ namespace formula_manage
|
||||
double conc=0;
|
||||
|
||||
System.Windows.Controls.TextBox curTextBox = sender as System.Windows.Controls.TextBox;
|
||||
int grid_row = Grid_RRODUCT.SelectedIndex; //获取当前行
|
||||
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
@@ -542,6 +584,7 @@ namespace formula_manage
|
||||
{
|
||||
System.Windows.MessageBox.Show("错误,重新输入");
|
||||
curTextBox.Text = "";
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -552,45 +595,150 @@ namespace formula_manage
|
||||
curTextBox.Text = "";
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
double Weight_t = Weight_ * conc;
|
||||
|
||||
Weight_ = Weight_* conc;
|
||||
DataRow row = RRODUCTdataTable.Rows[grid_row]; //ID列
|
||||
row.BeginEdit();
|
||||
row["STEP"] = Procedures_P.Text;
|
||||
row["CONC"] = string.Format("{0:N6}", conc);
|
||||
row["TARGET_WT"] = string.Format("{0:N3}", Weight_t);
|
||||
row.EndEdit();
|
||||
|
||||
DataRow row = RRODUCTdataTable.Rows[ID_N - 1]; //ID列
|
||||
row.BeginEdit();
|
||||
row["TARGET_WT"] = Weight_;
|
||||
row.EndEdit();
|
||||
|
||||
PressKey.PressKeys(Keys.Left, false);
|
||||
PressKey.PressKeys(Keys.Left, true);
|
||||
PressKey.PressKeys(Keys.Tab, false);
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
|
||||
DataRow rowadd = RRODUCTdataTable.NewRow(); //ID列
|
||||
rowadd = RRODUCTdataTable.NewRow();
|
||||
ID_N++;
|
||||
rowadd["ID"] = ID_N;
|
||||
// row["STEP"] = "1";
|
||||
rowadd["UNIT"] = "g";
|
||||
// row["STEP"] = Procedures_P.Text;
|
||||
RRODUCTdataTable.Rows.Add(rowadd);
|
||||
if (grid_row == (ID_N - 1))
|
||||
{
|
||||
PressKey.PressKeys(Keys.Left, false);
|
||||
PressKey.PressKeys(Keys.Left, true);
|
||||
PressKey.PressKeys(Keys.Tab, false);
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
|
||||
DataRow rowadd = RRODUCTdataTable.NewRow(); //ID列
|
||||
rowadd = RRODUCTdataTable.NewRow();
|
||||
ID_N++;
|
||||
rowadd["ID"] = ID_N;
|
||||
// row["STEP"] = "1";
|
||||
rowadd["UNIT"] = "g";
|
||||
// row["STEP"] = Procedures_P.Text;
|
||||
RRODUCTdataTable.Rows.Add(rowadd);
|
||||
}
|
||||
}
|
||||
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
||||
}
|
||||
}
|
||||
} //目标饱和度输入事件
|
||||
|
||||
private void CP_PRODUCT_CODE_LostFocus(object sender, RoutedEventArgs e)
|
||||
private void CP_PRODUCT_CODE_DropDownClosed(object sender, EventArgs e)//原料代码选择事件
|
||||
{
|
||||
/* System.Windows.Controls.ComboBox curComboBox = sender as System.Windows.Controls.ComboBox;
|
||||
string a = curComboBox.Text;
|
||||
double ang;
|
||||
|
||||
DataTable data = null;
|
||||
if (a != "")
|
||||
System.Windows.Controls.ComboBox curComboBox = sender as System.Windows.Controls.ComboBox;
|
||||
int grid_row = Grid_RRODUCT.SelectedIndex; //获取当前行
|
||||
|
||||
Code_ = curComboBox.Text;
|
||||
if (Code_ == "")
|
||||
{
|
||||
data = MainWindowViewModel.STUFFdatatemp.Select("ProductCode ='" + a + "'").CopyToDataTable();
|
||||
//Grid_RRODUCT.ItemsSource = data.Columns.//Add("ProductName").ToString();
|
||||
if (Procedures_N.Text == Procedures_P.Text)
|
||||
{
|
||||
MessageBoxResult P = System.Windows.MessageBox.Show("是否保存", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); //提示
|
||||
if (P == MessageBoxResult.Cancel) { }
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxResult P = System.Windows.MessageBox.Show("是否进入下一步", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); //提示
|
||||
if (P == MessageBoxResult.Cancel) return;
|
||||
|
||||
Procedures_P.Text = (int.Parse(Procedures_P.Text) + 1).ToString();
|
||||
PressKey.PressKeys(Keys.Tab, false);
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
DataRow[] r = MainWindowViewModel.STUFFdatatemp.Select("ProductCode ='" + Code_ + "'"); //查询判断原料代码是否有效
|
||||
if (!r.Any()) //检查原料信息
|
||||
{
|
||||
System.Windows.MessageBox.Show("原料不存在");
|
||||
curComboBox.Text = "";
|
||||
return;
|
||||
}
|
||||
|
||||
DataRow[] c = RRODUCTdataTable.Select("PRODUCT_CODE ='" + Code_ + "'");//查询判断原料代码是否重复
|
||||
if (c.Any())
|
||||
{
|
||||
System.Windows.MessageBox.Show("重复原料");
|
||||
return;
|
||||
}
|
||||
|
||||
Name_ = r[0].ItemArray[1].ToString();
|
||||
Type_ = r[0].ItemArray[2].ToString();
|
||||
Conc_ = r[0].ItemArray[3].ToString();
|
||||
|
||||
if (double.TryParse(list_Weight.Text, out ang))
|
||||
{
|
||||
Weight_ = double.Parse(list_Weight.Text) * double.Parse(Conc_) / 100;
|
||||
}
|
||||
|
||||
if ((Type_ == "0") || (Type_ == "3"))
|
||||
{
|
||||
Type_ = "%";
|
||||
if (double.TryParse(list_Weight.Text, out ang))
|
||||
{
|
||||
Weight_ = double.Parse(list_Weight.Text) * double.Parse(Conc_) * 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.MessageBox.Show("请先确认重量及浴比");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((Type_ == "1") || (Type_ == "2"))
|
||||
{
|
||||
Type_ = "g/L";
|
||||
|
||||
if (double.TryParse(list_Total.Text, out ang))
|
||||
{
|
||||
Weight_ = double.Parse(list_Total.Text) * double.Parse(Conc_) / 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.MessageBox.Show("请先确认重量及浴比");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (grid_row == -1) grid_row = 0;
|
||||
DataRow row = RRODUCTdataTable.Rows[grid_row]; //ID列
|
||||
row.BeginEdit();
|
||||
row["PRODUCT_CODE"] = Code_;
|
||||
row["PRODUCT_NAME"] = Name_;
|
||||
row["SHIFT"] = Type_;
|
||||
row.EndEdit();
|
||||
if (grid_row == (ID_N - 1))
|
||||
{
|
||||
PressKey.PressKeys(Keys.Right, false);
|
||||
PressKey.PressKeys(Keys.Right, true);
|
||||
PressKey.PressKeys(Keys.Tab, false);
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
PressKey.PressKeys(Keys.Right, false);
|
||||
PressKey.PressKeys(Keys.Right, true);
|
||||
PressKey.PressKeys(Keys.Up, false);
|
||||
PressKey.PressKeys(Keys.Up, true);
|
||||
PressKey.PressKeys(Keys.Tab, false);
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
}
|
||||
|
||||
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
||||
}
|
||||
|
||||
private void CP_PRODUCT_NAME_DropDownClosed(object sender, EventArgs e)//原料名选择事件
|
||||
{
|
||||
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,10 @@
|
||||
<TextBox x:Name="TimeFormat" HorizontalAlignment="Left" Height="20" Margin="85,250,0,0" TextWrapping="Wrap" Text="yyyyMMddHHmmss" VerticalAlignment="Top" Width="125"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="20" Margin="10,280,0,0" TextWrapping="Wrap" Text="排序格式" VerticalAlignment="Top" Width="75" FontSize="14"/>
|
||||
<TextBox x:Name="Order" HorizontalAlignment="Left" Height="20" Margin="85,280,0,0" TextWrapping="Wrap" Text="0001" VerticalAlignment="Top" Width="125"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="20" Margin="10,310,0,0" TextWrapping="Wrap" Text="常用重量" VerticalAlignment="Top" Width="75" FontSize="14"/>
|
||||
<TextBox x:Name="Weight" HorizontalAlignment="Left" Height="20" Margin="85,310,0,0" TextWrapping="Wrap" Text="0000" VerticalAlignment="Top" Width="125"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="20" Margin="10,340,0,0" TextWrapping="Wrap" Text="常用浴比" VerticalAlignment="Top" Width="75" FontSize="14"/>
|
||||
<TextBox x:Name="Proportion" HorizontalAlignment="Left" Height="20" Margin="85,340,0,0" TextWrapping="Wrap" Text="0000" VerticalAlignment="Top" Width="125"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -45,6 +45,8 @@ namespace formula_manage.Windows
|
||||
Configini.IniWritevalue("SOFTWARE_SET", " T1", Prepose.Text);
|
||||
Configini.IniWritevalue("SOFTWARE_SET", " T2", TimeFormat.Text);
|
||||
Configini.IniWritevalue("SOFTWARE_SET", " T3", Order.Text);
|
||||
Configini.IniWritevalue("SOFTWARE_SET", " T4", Weight.Text);
|
||||
Configini.IniWritevalue("SOFTWARE_SET", " T5", Proportion.Text);
|
||||
|
||||
System.IO.DirectoryInfo log = new System.IO.DirectoryInfo(@logpath);//生成日志文件目录
|
||||
FileStream fs = new FileStream(logPath, FileMode.Append, FileAccess.Write);
|
||||
@@ -70,7 +72,8 @@ namespace formula_manage.Windows
|
||||
Prepose.Text = Configini.IniReadvalue("SOFTWARE_SET", "T1"); //自定义料单前缀
|
||||
TimeFormat.Text = Configini.IniReadvalue("SOFTWARE_SET", "T2"); //自定义料单时间格式
|
||||
Order.Text = Configini.IniReadvalue("SOFTWARE_SET", "T3"); //自定义料单排序
|
||||
|
||||
Weight.Text = Configini.IniReadvalue("SOFTWARE_SET", "T4"); //自定义
|
||||
Proportion.Text = Configini.IniReadvalue("SOFTWARE_SET", "T5"); //自定义
|
||||
}
|
||||
private void Login_LINK_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user