代码如下 | 复制代码 |
public void NewRecord()
{ IsGetData = true; try { Cursor.Current = Cursors.WaitCursor; string strSQL = ""; //m_State = 0; this.tb_storeTableAdapter.Connection.ConnectionString = GlobalVariable.m_Conn;
if (GlobalVariable.Conn.State == ConnectionState.Closed) GlobalVariable.Conn.Open();
SqlCommand cmd = GlobalVariable.Conn.CreateCommand(); System.Data.SqlClient.SqlDataAdapter da = null; DataSet ds = new DataSet(); string ls_gcode="";
this.LblGCode.Text = ""; this.LblName.Text = ""; this.LblModel.Text = ""; if (this.hHDataSet.Tables["tb_store"] != null) { this.hHDataSet.Tables["tb_store"].Clear(); } if (this.TxtBarcode.Text.Trim().Length < 10)
{ strSQL = "Select c_gcode from tb_gds (nolock) " + " where c_gcode='" + this.TxtBarcode.Text.Trim() + "'"; cmd.CommandText = strSQL; cmd.CommandType = CommandType.Text; da = new SqlDataAdapter(cmd); da.Fill(ds, "tb_gds"); if (ds.Tables["tb_gds"].Rows.Count > 0) { ls_gcode = ds.Tables["tb_gds"].Rows[0]["c_gcode"].ToString(); } if (ls_gcode.Length <= 0)
{ //this.LblName.Text = "扫描的商品未找到!"; if (this.TxtBarcode.Text.Length > 0) MessageBox.Show("扫描的商品未找到!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } else { strSQL = "Select c_gcode from tb_barcode (nolock) " + " where c_barcode='" + this.TxtBarcode.Text.Trim() + "'"; cmd.CommandText = strSQL; cmd.CommandType = CommandType.Text; da = new SqlDataAdapter(cmd); da.Fill(ds, "c_barcode"); if (ds.Tables["c_barcode"].Rows.Count > 0) { ls_gcode = ds.Tables["c_barcode"].Rows[0]["c_gcode"].ToString(); } if (ls_gcode.Length <= 0)
{ //this.LblName.Text = "扫描的商品未找到!"; if (this.TxtBarcode.Text.Length > 0) MessageBox.Show("扫描的商品未找到!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } } strSQL = "Select a.c_gcode,a.c_name,a.c_model,b.c_number,b.c_move_in_number,b.c_move_out_number,b.c_onway_sale_number,b.c_onway_w_number " +
" from tb_gds a (nolock),tb_gdsadno b(nolock) " + " where a.c_gcode=b.c_gcode and b.c_gcode='" + ls_gcode + "' and b.c_store_id='" + GlobalVariable.m_CompID + "' "; cmd.CommandText = strSQL; cmd.CommandType = CommandType.Text; da = new SqlDataAdapter(cmd); if (this.hHDataSet.Tables["tb_store"] != null) { this.hHDataSet.Tables["tb_store"].Clear(); } da.Fill(this.hHDataSet, "tb_store"); GetDataList();
SumTotal(); da.Dispose();
ds.Dispose(); cmd.Dispose(); } catch (Exception ex) { MessageBox.Show("数据库连接失败! " + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } IsGetData = false;
Cursor.Current = Cursors.Default; } |
我的博物馆故事 官方安卓版v1.61.2
我的博物馆故事是一款以消除为主题的经营养成类手游,在这里玩家
专业模拟飞行10 手机版v12.2.4
专业模拟飞行10安卓版是一款飞行休闲手游,顶尖的物理飞行引擎
动物起义战斗模拟器二琳同款 最新版v4.1.1
动物起义战斗模拟器是一个非常有趣的模拟类游戏,玩家可以召唤各
迷你世界七周年 安卓手机版v1.43.0
迷你世界7周年是一款由《迷你世界》官方推出的庆祝特别版本,在
劫后公司无限资源版 v1.0.5.1
劫后公司内置菜单版是游戏的破解版本,在该版本中为玩家提供了内