@ -27,10 +27,9 @@ namespace formula_manage.Windows
/// </summary>
/// </summary>
public partial class Stuff : Window
public partial class Stuff : Window
{
{
public string INIPath = Convert . ToString ( System . AppDomain . CurrentDomain . BaseDirectory ) + "formula.ini" ; //配置文件路径
public string INIPath = Convert . ToString ( System . AppDomain . CurrentDomain . BaseDirectory ) + "formula.ini" ; //配置文件路径
int Button_ID = 0 ;
int Button_ID = 0 ;
string TEXT_SQLIP ;
string TEXT_SQLIP ;
string TEXT_SQLNAME ;
string TEXT_SQLNAME ;
string TEXT_SQMOD ;
string TEXT_SQMOD ;
@ -89,7 +88,7 @@ namespace formula_manage.Windows
/// </summary>
/// </summary>
private void DataGridEquipment_LoadingRow ( object sender , DataGridRowEventArgs e )
private void DataGridEquipment_LoadingRow ( object sender , DataGridRowEventArgs e )
{
{
// e.Row.Header = e.Row.GetIndex() + 1;
e . Row . Header = e . Row . GetIndex ( ) + 1 ;
}
}
private void Radiobutton ( object sender , EventArgs e )
private void Radiobutton ( object sender , EventArgs e )
@ -123,7 +122,10 @@ namespace formula_manage.Windows
}
}
}
}
private async void GridSql ( int e ) //查询数据库事件
/// <summary>
/// 查询数据库的方法
/// </summary>
private async void GridSql ( int e )
{
{
string Stuff_sql = null ;
string Stuff_sql = null ;
if ( e = = 0 ) Stuff_sql = "SELECT ProductCode ,ProductName , Price , SUPPLIER ,ProductType ,Color ,Concentration , GRAVITY FROM [Dispensing].[dbo].[PRODUCT]" ; //查询语句
if ( e = = 0 ) Stuff_sql = "SELECT ProductCode ,ProductName , Price , SUPPLIER ,ProductType ,Color ,Concentration , GRAVITY FROM [Dispensing].[dbo].[PRODUCT]" ; //查询语句
@ -250,7 +252,6 @@ namespace formula_manage.Windows
}
}
else
else
{
{
Stuff_sql = string . Format ( "UPDATE [dbo].[PRODUCT] SET ProductName='" + Product_Name + "',Price='" + _ Price + "',SUPPLIER='" + _ SUPPLIER + "',ProductType=" + int_stuff_ProductType + ",Color=" + ColorCode_SQL + ",Concentration=" + _ Concentration + ",GRAVITY=" + _ GRAVITY + " Where ProductCode='" + Product_Code + "'" ) ;
Stuff_sql = string . Format ( "UPDATE [dbo].[PRODUCT] SET ProductName='" + Product_Name + "',Price='" + _ Price + "',SUPPLIER='" + _ SUPPLIER + "',ProductType=" + int_stuff_ProductType + ",Color=" + ColorCode_SQL + ",Concentration=" + _ Concentration + ",GRAVITY=" + _ GRAVITY + " Where ProductCode='" + Product_Code + "'" ) ;
await conn_SC . OpenAsync ( ) ; //打开数据连接
await conn_SC . OpenAsync ( ) ; //打开数据连接
SqlCommand INSERT_cmd = new SqlCommand ( Stuff_sql , conn_SC ) ;
SqlCommand INSERT_cmd = new SqlCommand ( Stuff_sql , conn_SC ) ;