Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage
This commit is contained in:
commit
a63feef32f
2 files changed
+17
-43
No files matched your search
+1
-1
@@ -225,7 +225,7 @@
|
|||||||
|
|
||||||
<Button Content="确认" HorizontalAlignment="Right" Height="40" Width="80" Margin="0,0,140,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="confirm" Grid.Column="1"/>
|
<Button Content="确认" HorizontalAlignment="Right" Height="40" Width="80" Margin="0,0,140,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="confirm" Grid.Column="1"/>
|
||||||
<Button Content="打印" HorizontalAlignment="Right" Height="40" Width="80" Margin="0,0,55,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="print" IsTabStop="False" Focusable ="False" Grid.Column="1"/>
|
<Button Content="打印" HorizontalAlignment="Right" Height="40" Width="80" Margin="0,0,55,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="print" IsTabStop="False" Focusable ="False" Grid.Column="1"/>
|
||||||
<Button Content="保存" HorizontalAlignment="Left" Height="40" Width="80" Margin="15,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="save" IsTabStop="False" Focusable ="False"/>
|
<Button x:Name="Save" Content="保存" IsEnabled="False" HorizontalAlignment="Left" Height="40" Width="80" Margin="15,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="save" IsTabStop="False" Focusable ="False"/>
|
||||||
<Button Content="删除" HorizontalAlignment="Left" Height="40" Width="80" Margin="100,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="delete" IsTabStop="False" Focusable ="False"/>
|
<Button Content="删除" HorizontalAlignment="Left" Height="40" Width="80" Margin="100,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="delete" IsTabStop="False" Focusable ="False"/>
|
||||||
|
|
||||||
<Grid Grid.Column="1" Height="325" Margin="148,35,5,0" VerticalAlignment="Top" Background="#FFF7F7F7">
|
<Grid Grid.Column="1" Height="325" Margin="148,35,5,0" VerticalAlignment="Top" Background="#FFF7F7F7">
|
||||||
|
|||||||
+16
-42
@@ -256,15 +256,13 @@ namespace formula_manage
|
|||||||
|
|
||||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
||||||
string PreposeT4 = Configini.IniReadvalue("SOFTWARE_SET", "T6"); //
|
string PreposeT4 = Configini.IniReadvalue("SOFTWARE_SET", "T6"); //
|
||||||
string time = System.DateTime.Now.ToString(PreposeT);
|
string time = System.DateTime.Now.ToString(PreposeT); //获取系统时
|
||||||
if (PreposeT4 != time) PreposeSl = 0;
|
if (PreposeT4 != time) PreposeSl = 0;
|
||||||
PreposeSl = PreposeSl + 1;
|
PreposeSl = PreposeSl + 1;
|
||||||
str_Prepose = String.Format("{0:D" + preposeL + "}", PreposeSl);
|
str_Prepose = String.Format("{0:D" + preposeL + "}", PreposeSl);
|
||||||
|
|
||||||
Number.Text = Prepose + time + str_Prepose; //生成料单号
|
Number.Text = Prepose + time + str_Prepose; //生成料单号
|
||||||
|
ReDye.Text = "0";
|
||||||
Configini.IniWritevalue("SOFTWARE_SET", " T6", time);
|
Configini.IniWritevalue("SOFTWARE_SET", " T6", time); //保存当前时
|
||||||
|
|
||||||
}
|
}
|
||||||
private void Tb_KeyPress(object sender, TextCompositionEventArgs e)//输入事件
|
private void Tb_KeyPress(object sender, TextCompositionEventArgs e)//输入事件
|
||||||
{
|
{
|
||||||
@@ -293,7 +291,7 @@ namespace formula_manage
|
|||||||
Windows.Sql sql = new Windows.Sql();
|
Windows.Sql sql = new Windows.Sql();
|
||||||
sql.ShowDialog();//实例化并置顶打开数据库设置窗口
|
sql.ShowDialog();//实例化并置顶打开数据库设置窗口
|
||||||
}
|
}
|
||||||
private void SQLBAK(object sender, RoutedEventArgs e)
|
private void SQLBAK(object sender, RoutedEventArgs e)//打开数据备份窗口
|
||||||
{
|
{
|
||||||
MessageBoxResult sql_bak = System.Windows.MessageBox.Show("注意此功能仅作用与本地数据库(Dispensing)对于远端数据库的操作可能失败如果需要继续操作单击确定", "SQL", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); //连接失败提示
|
MessageBoxResult sql_bak = System.Windows.MessageBox.Show("注意此功能仅作用与本地数据库(Dispensing)对于远端数据库的操作可能失败如果需要继续操作单击确定", "SQL", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); //连接失败提示
|
||||||
if (sql_bak == MessageBoxResult.OK)
|
if (sql_bak == MessageBoxResult.OK)
|
||||||
@@ -402,9 +400,9 @@ namespace formula_manage
|
|||||||
System.Windows.MessageBox.Show("数据访问失败,重试");
|
System.Windows.MessageBox.Show("数据访问失败,重试");
|
||||||
return;
|
return;
|
||||||
} //单号重复检查
|
} //单号重复检查
|
||||||
if (Machine.Text =="")
|
if (Machine.Text == "")
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("请选择机台", "注意",MessageBoxButton.OK , MessageBoxImage.Question) ;
|
System.Windows.MessageBox.Show("请选择机台", "注意", MessageBoxButton.OK, MessageBoxImage.Question);
|
||||||
return;
|
return;
|
||||||
} //机台检查
|
} //机台检查
|
||||||
if (int.Parse(Procedures_N.Text) > int.Parse(Procedures_P.Text)) //步骤检查
|
if (int.Parse(Procedures_N.Text) > int.Parse(Procedures_P.Text)) //步骤检查
|
||||||
@@ -413,12 +411,13 @@ namespace formula_manage
|
|||||||
if (result == MessageBoxResult.OK)
|
if (result == MessageBoxResult.OK)
|
||||||
{
|
{
|
||||||
|
|
||||||
} else return;
|
}
|
||||||
|
else return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int t = RRODUCTdataTable.Rows.Count; //获取数据行包含空白行
|
int t = RRODUCTdataTable.Rows.Count; //获取数据行包含空白行
|
||||||
|
|
||||||
for (int i=0; i < t; i++)
|
for (int i = 0; i < t; i++)
|
||||||
{
|
{
|
||||||
DataRow r = RRODUCTdataTable.Rows[i]; //ID列
|
DataRow r = RRODUCTdataTable.Rows[i]; //ID列
|
||||||
r.BeginEdit();
|
r.BeginEdit();
|
||||||
@@ -426,19 +425,12 @@ namespace formula_manage
|
|||||||
r["ReDye"] = int.Parse(ReDye.Text);
|
r["ReDye"] = int.Parse(ReDye.Text);
|
||||||
|
|
||||||
r.EndEdit();
|
r.EndEdit();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
RRODUCTdataTable.Rows[t-1].Delete();
|
RRODUCTdataTable.Rows[t - 1].Delete();
|
||||||
RRODUCTdataTable.AcceptChanges();
|
RRODUCTdataTable.AcceptChanges();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// SqlCommand insertcommand = new SqlCommand("INSERT INTO [Dispensing].[dbo].[DYELOTS_RECIPE]([CompanyName],[CompanyCode],[Address],[Owner],[Memo])" +"VALUES(@CompanyName, @CompanyCode,@Address,@Owner,@Memo)", conn_SC);
|
|
||||||
|
|
||||||
SqlConnection destinationConnection = new SqlConnection(Connstr_SC); //创建一个数据库连接;
|
SqlConnection destinationConnection = new SqlConnection(Connstr_SC); //创建一个数据库连接;
|
||||||
destinationConnection.Open();
|
destinationConnection.Open(); //打开连接
|
||||||
//SqlBulkCopyColumnMapping()
|
|
||||||
SqlBulkCopy bulkCopy = new SqlBulkCopy(destinationConnection);// 实例化 sqlbulkcopy;
|
SqlBulkCopy bulkCopy = new SqlBulkCopy(destinationConnection);// 实例化 sqlbulkcopy;
|
||||||
bulkCopy.DestinationTableName = "dbo.DYELOTS_RECIPE";// 目标表名称/
|
bulkCopy.DestinationTableName = "dbo.DYELOTS_RECIPE";// 目标表名称/
|
||||||
bulkCopy.ColumnMappings.Add("DYELOT", "Dyelot");
|
bulkCopy.ColumnMappings.Add("DYELOT", "Dyelot");
|
||||||
@@ -454,7 +446,6 @@ namespace formula_manage
|
|||||||
bulkCopy.ColumnMappings.Add("REMARK", "REMARK");
|
bulkCopy.ColumnMappings.Add("REMARK", "REMARK");
|
||||||
bulkCopy.WriteToServer(RRODUCTdataTable); //将传入的数据写到数据库;
|
bulkCopy.WriteToServer(RRODUCTdataTable); //将传入的数据写到数据库;
|
||||||
|
|
||||||
|
|
||||||
DataRow row = RRODUCTdataTable.NewRow(); //ID列
|
DataRow row = RRODUCTdataTable.NewRow(); //ID列
|
||||||
row["ID"] = ID_N;
|
row["ID"] = ID_N;
|
||||||
row["STEP"] = Procedures_P.Text;
|
row["STEP"] = Procedures_P.Text;
|
||||||
@@ -463,16 +454,12 @@ namespace formula_manage
|
|||||||
|
|
||||||
Grid_RRODUCT.ItemsSource = RRODUCTdataTable.DefaultView;
|
Grid_RRODUCT.ItemsSource = RRODUCTdataTable.DefaultView;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Procedures_N.Text = "1";
|
Procedures_N.Text = "1";
|
||||||
Procedures_P.Text = "1";
|
Procedures_P.Text = "1";
|
||||||
|
|
||||||
|
|
||||||
Number_Event();
|
Number_Event();
|
||||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); //记录当前单序号
|
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); //记录当前单序号
|
||||||
Configini.IniWritevalue("SOFTWARE_SET", " T3", str_Prepose);
|
Configini.IniWritevalue("SOFTWARE_SET", " T3", str_Prepose);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_NewOrder(object sender, RoutedEventArgs e) //新料单按钮
|
private void Button_NewOrder(object sender, RoutedEventArgs e) //新料单按钮
|
||||||
@@ -697,6 +684,7 @@ namespace formula_manage
|
|||||||
PressKey.PressKeys(Keys.Tab, true);
|
PressKey.PressKeys(Keys.Tab, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Save.IsEnabled = false;
|
||||||
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
||||||
}
|
}
|
||||||
private void CP_CONC_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)//目标饱和度输入事件
|
private void CP_CONC_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)//目标饱和度输入事件
|
||||||
@@ -743,11 +731,12 @@ namespace formula_manage
|
|||||||
PressKey.PressKeys(Keys.Tab, true);
|
PressKey.PressKeys(Keys.Tab, true);
|
||||||
|
|
||||||
DataRow rowadd = RRODUCTdataTable.NewRow(); //ID列
|
DataRow rowadd = RRODUCTdataTable.NewRow(); //ID列
|
||||||
rowadd = RRODUCTdataTable.NewRow();
|
//rowadd = RRODUCTdataTable.NewRow();
|
||||||
ID_N++;
|
ID_N++;
|
||||||
rowadd["ID"] = ID_N;
|
rowadd["ID"] = ID_N;
|
||||||
rowadd["UNIT"] = "g";
|
rowadd["UNIT"] = "g";
|
||||||
RRODUCTdataTable.Rows.Add(rowadd);
|
RRODUCTdataTable.Rows.Add(rowadd);
|
||||||
|
Save.IsEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
||||||
@@ -842,24 +831,8 @@ namespace formula_manage
|
|||||||
row["PRODUCT_NAME"] = Name_;
|
row["PRODUCT_NAME"] = Name_;
|
||||||
row["SHIFT"] = Type_;
|
row["SHIFT"] = Type_;
|
||||||
row.EndEdit();
|
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
|
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
||||||
|
Save.IsEnabled = false;
|
||||||
}
|
}
|
||||||
private void CP_PRODUCT_NAME_DropDownClosed(object sender, EventArgs e)//原料名选择事件
|
private void CP_PRODUCT_NAME_DropDownClosed(object sender, EventArgs e)//原料名选择事件
|
||||||
{
|
{
|
||||||
@@ -924,6 +897,7 @@ namespace formula_manage
|
|||||||
row["SHIFT"] = Type_;
|
row["SHIFT"] = Type_;
|
||||||
row.EndEdit();
|
row.EndEdit();
|
||||||
}
|
}
|
||||||
|
Save.IsEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user