原料离子类型选项调整
This commit is contained in:
commit
75cc5dc5c3
3 files changed
+49
-18
No files matched your search
+4
-1
@@ -124,13 +124,16 @@
|
||||
<TextBlock HorizontalAlignment="Left" Height="30" Margin="670,0,0,100" TextWrapping="Wrap" Text="原料类型"
|
||||
VerticalAlignment="Bottom" Width="100" FontSize="20"/>
|
||||
<!--离子类型-->
|
||||
<ComboBox x:Name="stuff_ion" HorizontalAlignment="Left" Height="30" Margin="755,0,0,50" Text=""
|
||||
<ComboBox x:Name="Stuff_ion" HorizontalAlignment="Left" Height="30" Margin="755,0,0,50" Text=""
|
||||
VerticalAlignment="Bottom" Width="100" FontSize="16" IsReadOnly="True" IsEditable="True">
|
||||
<ComboBoxItem Content="分散"></ComboBoxItem>
|
||||
<ComboBoxItem Content="酸性"></ComboBoxItem>
|
||||
<ComboBoxItem Content="活性"></ComboBoxItem>
|
||||
<ComboBoxItem Content="中性"></ComboBoxItem>
|
||||
<ComboBoxItem Content="硫化"></ComboBoxItem>
|
||||
<ComboBoxItem Content="阳离子"></ComboBoxItem>
|
||||
<ComboBoxItem Content="阴离子"></ComboBoxItem>
|
||||
<ComboBoxItem Content="非离子"></ComboBoxItem>
|
||||
<ComboBoxItem Content="酞菁"></ComboBoxItem>
|
||||
<ComboBoxItem Content="直接"></ComboBoxItem>
|
||||
</ComboBox>
|
||||
|
||||
+18
-12
@@ -178,13 +178,16 @@ namespace formula_manage.Windows
|
||||
else if (this.stuff_ProductType.Text == "液体染料")
|
||||
int_stuff_ProductType = 3;
|
||||
|
||||
if(stuff_ion.Text == "分散") int_stuff_ion = 0;
|
||||
else if (stuff_ion.Text == "酸性") int_stuff_ion = 1;
|
||||
else if (stuff_ion.Text == "活性") int_stuff_ion = 2;
|
||||
else if (stuff_ion.Text == "硫化") int_stuff_ion = 3;
|
||||
else if (stuff_ion.Text == "阳离子") int_stuff_ion = 4;
|
||||
else if (stuff_ion.Text == "酞菁") int_stuff_ion = 5;
|
||||
else if (stuff_ion.Text == "直接") int_stuff_ion = 6;
|
||||
if(Stuff_ion.Text == "分散") int_stuff_ion = 0;
|
||||
else if (Stuff_ion.Text == "酸性") int_stuff_ion = 1;
|
||||
else if (Stuff_ion.Text == "活性") int_stuff_ion = 2;
|
||||
else if (Stuff_ion.Text == "中性") int_stuff_ion = 3;
|
||||
else if (Stuff_ion.Text == "硫化") int_stuff_ion = 4;
|
||||
else if (Stuff_ion.Text == "阳离子") int_stuff_ion = 5;
|
||||
else if (Stuff_ion.Text == "阴离子") int_stuff_ion = 6;
|
||||
else if (Stuff_ion.Text == "非离子") int_stuff_ion = 7;
|
||||
else if (Stuff_ion.Text == "酞菁") int_stuff_ion = 8;
|
||||
else if (Stuff_ion.Text == "直接") int_stuff_ion = 9;
|
||||
|
||||
if ((re_number.IsMatch(this.stuff_Price.Text) == false) && (stuff_Price.Text != ""))
|
||||
System.Windows.MessageBox.Show("ERR:价格信息错误", "错误");//检查价格输入信息
|
||||
@@ -245,9 +248,10 @@ namespace formula_manage.Windows
|
||||
SqlCommand INSERT_cmd = new SqlCommand(Stuff_sql, conn_SC);
|
||||
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
|
||||
|
||||
if(stuff_ion.Text !="")Stuff_sql = string.Format("UPDATE [dbo].[PRODUCT] SET [ProductIon_Type] ="+ int_stuff_ion + " Where ProductCode='" + Product_Code + "'");
|
||||
if (Stuff_ion.Text != "") Stuff_sql = string.Format("UPDATE [dbo].[PRODUCT] SET [ProductIon_Type] =" + int_stuff_ion + " Where ProductCode='" + Product_Code + "'");
|
||||
else Stuff_sql = string.Format("UPDATE [dbo].[PRODUCT] SET [ProductIon_Type] =NULL Where ProductCode='" + Product_Code + "'");
|
||||
SqlCommand Stuff_sql_cmd = new SqlCommand(Stuff_sql, conn_SC);
|
||||
INSERT_cmd.ExecuteNonQuery(); //执行语句
|
||||
Stuff_sql_cmd.ExecuteNonQuery(); //执行语句
|
||||
|
||||
conn_SC.Close(); //关闭连接
|
||||
if (sql_in == 0)
|
||||
@@ -270,9 +274,10 @@ namespace formula_manage.Windows
|
||||
SqlCommand INSERT_cmd = new SqlCommand(Stuff_sql, conn_SC);
|
||||
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
|
||||
|
||||
if (stuff_ion.Text != "") Stuff_sql = string.Format("UPDATE [dbo].[PRODUCT] SET [ProductIon_Type] =" + int_stuff_ion + " Where ProductCode='" + Product_Code + "'");
|
||||
if (Stuff_ion.Text != "") Stuff_sql = string.Format("UPDATE [dbo].[PRODUCT] SET [ProductIon_Type] =" + int_stuff_ion + " Where ProductCode='" + Product_Code + "'");
|
||||
else Stuff_sql = string.Format("UPDATE [dbo].[PRODUCT] SET [ProductIon_Type] =NULL Where ProductCode='" + Product_Code + "'");
|
||||
SqlCommand Stuff_sql_cmd = new SqlCommand(Stuff_sql, conn_SC);
|
||||
INSERT_cmd.ExecuteNonQuery(); //执行语句
|
||||
Stuff_sql_cmd.ExecuteNonQuery(); //执行语句
|
||||
|
||||
conn_SC.Close(); //关闭连接
|
||||
if (sql_in == 0)
|
||||
@@ -355,7 +360,8 @@ namespace formula_manage.Windows
|
||||
stuff_ProductName.Text = DataGridStuff_ProductName.Trim();//原料名称,去除空白字符
|
||||
stuff_Price.Text = DataGridStuff_Price;//价格
|
||||
stuff_ProductType.Text = DataGridStuff_ProductType;//类型
|
||||
stuff_ion.Text = DataGridStuff_stuff_ion;
|
||||
if (DataGridStuff_stuff_ion == "未知类型") Stuff_ion.Text = "";
|
||||
else Stuff_ion.Text = DataGridStuff_stuff_ion;
|
||||
stuff_SUPPLIER.Text = DataGridstuff_SUPPLIER;//供应商
|
||||
/*stuff_Color.Text = DataGridStuff_Color;//色彩数据*/
|
||||
stuff_Concentration.Text = DataGridStuff_Concentration;//浓度
|
||||
|
||||
Reference in new issue
Block a user