|
|
@ -178,13 +178,16 @@ namespace formula_manage.Windows |
|
|
else if (this.stuff_ProductType.Text == "液体染料") |
|
|
else if (this.stuff_ProductType.Text == "液体染料") |
|
|
int_stuff_ProductType = 3; |
|
|
int_stuff_ProductType = 3; |
|
|
|
|
|
|
|
|
if(stuff_ion.Text == "分散") int_stuff_ion = 0; |
|
|
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 = 1; |
|
|
else if (stuff_ion.Text == "活性") int_stuff_ion = 2; |
|
|
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 = 3; |
|
|
else if (stuff_ion.Text == "阳离子") int_stuff_ion = 4; |
|
|
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 = 5; |
|
|
else if (stuff_ion.Text == "直接") int_stuff_ion = 6; |
|
|
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 != "")) |
|
|
if ((re_number.IsMatch(this.stuff_Price.Text) == false) && (stuff_Price.Text != "")) |
|
|
System.Windows.MessageBox.Show("ERR:价格信息错误", "错误");//检查价格输入信息
|
|
|
System.Windows.MessageBox.Show("ERR:价格信息错误", "错误");//检查价格输入信息
|
|
|
@ -245,9 +248,10 @@ namespace formula_manage.Windows |
|
|
SqlCommand INSERT_cmd = new SqlCommand(Stuff_sql, conn_SC); |
|
|
SqlCommand INSERT_cmd = new SqlCommand(Stuff_sql, conn_SC); |
|
|
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
|
|
|
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); |
|
|
SqlCommand Stuff_sql_cmd = new SqlCommand(Stuff_sql, conn_SC); |
|
|
INSERT_cmd.ExecuteNonQuery(); //执行语句
|
|
|
Stuff_sql_cmd.ExecuteNonQuery(); //执行语句
|
|
|
|
|
|
|
|
|
conn_SC.Close(); //关闭连接
|
|
|
conn_SC.Close(); //关闭连接
|
|
|
if (sql_in == 0) |
|
|
if (sql_in == 0) |
|
|
@ -270,9 +274,10 @@ namespace formula_manage.Windows |
|
|
SqlCommand INSERT_cmd = new SqlCommand(Stuff_sql, conn_SC); |
|
|
SqlCommand INSERT_cmd = new SqlCommand(Stuff_sql, conn_SC); |
|
|
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
|
|
|
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); |
|
|
SqlCommand Stuff_sql_cmd = new SqlCommand(Stuff_sql, conn_SC); |
|
|
INSERT_cmd.ExecuteNonQuery(); //执行语句
|
|
|
Stuff_sql_cmd.ExecuteNonQuery(); //执行语句
|
|
|
|
|
|
|
|
|
conn_SC.Close(); //关闭连接
|
|
|
conn_SC.Close(); //关闭连接
|
|
|
if (sql_in == 0) |
|
|
if (sql_in == 0) |
|
|
@ -355,7 +360,8 @@ namespace formula_manage.Windows |
|
|
stuff_ProductName.Text = DataGridStuff_ProductName.Trim();//原料名称,去除空白字符
|
|
|
stuff_ProductName.Text = DataGridStuff_ProductName.Trim();//原料名称,去除空白字符
|
|
|
stuff_Price.Text = DataGridStuff_Price;//价格
|
|
|
stuff_Price.Text = DataGridStuff_Price;//价格
|
|
|
stuff_ProductType.Text = DataGridStuff_ProductType;//类型
|
|
|
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_SUPPLIER.Text = DataGridstuff_SUPPLIER;//供应商
|
|
|
/*stuff_Color.Text = DataGridStuff_Color;//色彩数据*/ |
|
|
/*stuff_Color.Text = DataGridStuff_Color;//色彩数据*/ |
|
|
stuff_Concentration.Text = DataGridStuff_Concentration;//浓度
|
|
|
stuff_Concentration.Text = DataGridStuff_Concentration;//浓度
|
|
|
|