Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage
This commit is contained in:
commit
a63feef32f
2 files changed
+13
-39
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,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"/>
|
||||
|
||||
<Grid Grid.Column="1" Height="325" Margin="148,35,5,0" VerticalAlignment="Top" Background="#FFF7F7F7">
|
||||
|
||||
+12
-38
@@ -256,15 +256,13 @@ namespace formula_manage
|
||||
|
||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
|
||||
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;
|
||||
PreposeSl = PreposeSl + 1;
|
||||
str_Prepose = String.Format("{0:D" + preposeL + "}", PreposeSl);
|
||||
|
||||
Number.Text = Prepose + time + str_Prepose; //生成料单号
|
||||
|
||||
Configini.IniWritevalue("SOFTWARE_SET", " T6", time);
|
||||
|
||||
ReDye.Text = "0";
|
||||
Configini.IniWritevalue("SOFTWARE_SET", " T6", time); //保存当前时
|
||||
}
|
||||
private void Tb_KeyPress(object sender, TextCompositionEventArgs e)//输入事件
|
||||
{
|
||||
@@ -293,7 +291,7 @@ namespace formula_manage
|
||||
Windows.Sql sql = new Windows.Sql();
|
||||
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); //连接失败提示
|
||||
if (sql_bak == MessageBoxResult.OK)
|
||||
@@ -413,7 +411,8 @@ namespace formula_manage
|
||||
if (result == MessageBoxResult.OK)
|
||||
{
|
||||
|
||||
} else return;
|
||||
}
|
||||
else return;
|
||||
}
|
||||
|
||||
int t = RRODUCTdataTable.Rows.Count; //获取数据行包含空白行
|
||||
@@ -426,19 +425,12 @@ namespace formula_manage
|
||||
r["ReDye"] = int.Parse(ReDye.Text);
|
||||
|
||||
r.EndEdit();
|
||||
|
||||
|
||||
}
|
||||
RRODUCTdataTable.Rows[t - 1].Delete();
|
||||
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); //创建一个数据库连接;
|
||||
destinationConnection.Open();
|
||||
//SqlBulkCopyColumnMapping()
|
||||
destinationConnection.Open(); //打开连接
|
||||
SqlBulkCopy bulkCopy = new SqlBulkCopy(destinationConnection);// 实例化 sqlbulkcopy;
|
||||
bulkCopy.DestinationTableName = "dbo.DYELOTS_RECIPE";// 目标表名称/
|
||||
bulkCopy.ColumnMappings.Add("DYELOT", "Dyelot");
|
||||
@@ -454,7 +446,6 @@ namespace formula_manage
|
||||
bulkCopy.ColumnMappings.Add("REMARK", "REMARK");
|
||||
bulkCopy.WriteToServer(RRODUCTdataTable); //将传入的数据写到数据库;
|
||||
|
||||
|
||||
DataRow row = RRODUCTdataTable.NewRow(); //ID列
|
||||
row["ID"] = ID_N;
|
||||
row["STEP"] = Procedures_P.Text;
|
||||
@@ -463,16 +454,12 @@ namespace formula_manage
|
||||
|
||||
Grid_RRODUCT.ItemsSource = RRODUCTdataTable.DefaultView;
|
||||
|
||||
|
||||
|
||||
Procedures_N.Text = "1";
|
||||
Procedures_P.Text = "1";
|
||||
|
||||
|
||||
Number_Event();
|
||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); //记录当前单序号
|
||||
Configini.IniWritevalue("SOFTWARE_SET", " T3", str_Prepose);
|
||||
|
||||
}
|
||||
|
||||
private void Button_NewOrder(object sender, RoutedEventArgs e) //新料单按钮
|
||||
@@ -697,6 +684,7 @@ namespace formula_manage
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
}
|
||||
}
|
||||
Save.IsEnabled = false;
|
||||
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
||||
}
|
||||
private void CP_CONC_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)//目标饱和度输入事件
|
||||
@@ -743,11 +731,12 @@ namespace formula_manage
|
||||
PressKey.PressKeys(Keys.Tab, true);
|
||||
|
||||
DataRow rowadd = RRODUCTdataTable.NewRow(); //ID列
|
||||
rowadd = RRODUCTdataTable.NewRow();
|
||||
//rowadd = RRODUCTdataTable.NewRow();
|
||||
ID_N++;
|
||||
rowadd["ID"] = ID_N;
|
||||
rowadd["UNIT"] = "g";
|
||||
RRODUCTdataTable.Rows.Add(rowadd);
|
||||
Save.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
|
||||
@@ -842,24 +831,8 @@ namespace formula_manage
|
||||
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
|
||||
Save.IsEnabled = false;
|
||||
}
|
||||
private void CP_PRODUCT_NAME_DropDownClosed(object sender, EventArgs e)//原料名选择事件
|
||||
{
|
||||
@@ -924,6 +897,7 @@ namespace formula_manage
|
||||
row["SHIFT"] = Type_;
|
||||
row.EndEdit();
|
||||
}
|
||||
Save.IsEnabled = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user