代码如下 | 复制代码 |
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; } |
敢达决战官方正版 安卓版v6.7.9
下载敢达决战 安卓版v6.7.9
下载像素火影骨架佐助 (Perseverance Fire Shadow)手机版v1.16
下载要塞英雄 安卓版v33.20.0-39082670-Android
下载梦想城镇vivo最新版本 安卓版v12.0.1
梦想城镇vivo版是这款卡通风模拟经营类手游的渠道服版本,玩
怦然心动的瞬间 安卓版v1.0
怦然心动的瞬间是一款真人向的恋爱互动游戏,在游戏中玩家将扮演
曼尼汉堡店游戏 安卓版v1.0.3
曼尼汉堡店是一款非常好玩的精品恐怖类型冒险游戏,在这款游戏中
现代总统模拟器去广告版 安卓版v1.0.46
现代总统模拟器是一款休闲养成类游戏,可能对于不少的玩家来说都
现代总统模拟器付费完整版 安卓版v1.0.46
现代总统模拟器高级版在商店是需要付费的,相对于普通版本,高级