private void BindControls() { if (JCH != null) { tbserialnum.Text = JCH.strJCSerialNum; tbGoodsname.Text = JCH.strJCGoodsName; tbgoodsid.Text = JCH.strJCGoodsID; djcdate.Value = JCH.dJCDate; good = goodmethod.Find(JCH.strJCGoodsName); tbModel.Text = JCH.strJCModelno; tbitemid.Text = JCH.strJCItemID; tbMaterial.Text = JCH.strJCMaterial; if (JCH.imJCimage != null) { MemoryStream buf = new MemoryStream((byte[])JCH.imJCimage); Image image = Image.FromStream(buf, true); pictureBox1.Image = image; } tbOperator.Text = JCH.strJCOperator; tbCarno.Text = JCH.strJCCarNO; tbhgsl.Value = JCH.dJCHGSL; tbpssl.Value = JCH.dJCPSSL; tbghsl.Value = JCH.dJCKHSL; tbklsl.Value = JCH.dJCKLSL; } }
private void BindControls() { if (FH != null) { tbserialnum.Text = FH.strFSerialNum; tbGoodsname.Text = FH.strFGoodsName; tbgoodsid.Text = FH.strFGoodsID; dFdate.Value = FH.dFDate; good = goodmethod.Find(FH.strFGoodsName); tbModel.Text = FH.strFModelno; tbitemid.Text = FH.strFItemID; tbMaterial.Text = FH.strFMaterial; // if (FH.imFimage != null) // { // MemoryStream buf = new MemoryStream((byte[])FH.imFimage); // Image image = Image.FromStream(buf, true); // pictureBox1.Image = image; // } tbOperator.Text = FH.strFOperator; //tbCarno.Text = FH.strFCarNO; tbhgsl.Value = FH.dFHGSL; //tbpssl.Value = FH.dFPSSL; //tbghsl.Value = FH.dFKHSL; //tbklsl.Value = FH.dFKLSL; } }
public tb_GoodsInfo Find(string _goodsname) { tb_GoodsInfo goods = new tb_GoodsInfo(); string sql = "select GoodId,GoodName,ItemNO,ModelNO,GoodMaterial,FImagePath from tb_GoodsInfo where GoodName ='" + _goodsname + "'"; DataSet ds = dbl.GetDataset(sql); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { goods.strGoodsId = ds.Tables[0].Rows[i][0].ToString(); goods.strGoodsName = ds.Tables[0].Rows[i][1].ToString(); goods.strItemNO = ds.Tables[0].Rows[i][2].ToString(); goods.strModelNO = ds.Tables[0].Rows[i][3].ToString(); goods.strGoodMaterial = ds.Tables[0].Rows[i][4].ToString(); goods.strFImagePath = ds.Tables[0].Rows[i][5].ToString(); } } } } return(goods); }
public int tb_GoodsInfoAdd( tb_GoodsInfo good ) { int intFalg = 0; try { /* if (ishaspics) * { * string str_Add = "insert into tb_GoodsInfo(GoodId,GoodName,ItemNO,ModelNO,GoodMaterial,FCreater,FCreateDate,fImage) values( "; * str_Add += " '" + good.strGoodsId + "','" + good.strGoodsName + "',"; * str_Add += " '" + good.strItemNO + "',"; * str_Add += " '" + good.strModelNO + "','" + good.strGoodMaterial + "','" + good.strFCreater + "','" + good.dFCreateDate + "',@img )"; * intFalg = dbc.ExeInfochange(str_Add, "@img", good.image); * } * else * { */ string str_Add = "insert into tb_GoodsInfo(GoodId,GoodName,ItemNO,ModelNO,GoodMaterial,FCreater,FCreateDate,FImagePath) values( "; str_Add += " '" + good.strGoodsId + "','" + good.strGoodsName + "',"; str_Add += " '" + good.strItemNO + "',"; str_Add += " '" + good.strModelNO + "','" + good.strGoodMaterial + "','" + good.strFCreater + "','" + good.dFCreateDate + "','" + good.strFImagePath + "')";; //str_Add += " '" + good.strFColor + "','" + good.strFTypeSteps1 + "','" + good.strFTypeSteps2 + "','" + good.strFTypeSteps3 + "','" + good.strFColorSteps + "'," + good.iFIsStop+ string sql = "select Count(1) from tb_GoodsInfo where GoodId='" + good.strGoodsId + "'"; //SqlCommand cmd1 = new SqlCommand(sql, conn); int count = dbc.ExecuteSelect(sql); if (count > 0) { MessageUtil.ShowError("产品编号已存在!"); return(0); } else { intFalg = dbc.ExeInfochange(str_Add); //} return(intFalg); } } catch (Exception ee) { MessageBox.Show(ee.ToString()); return(intFalg); } }
private void BindControls() { if (JCH != null) { tbserialnum.Text = JCH.strJCSerialNum; tbGoodsname.Text = JCH.strJCGoodsName; tbgoodsid.Text = JCH.strJCGoodsID; djcdate.Value = JCH.dJCDate; good = goodmethod.Find(JCH.strJCGoodsName); tbModel.Text = JCH.strJCModelno; tbitemid.Text = JCH.strJCItemID; tbMaterial.Text = JCH.strJCMaterial; tbOperator.Text = JCH.strJCOperator; tbCarno.Text = JCH.strJCCarNO; tbhgsl.Value = JCH.dJCHGSL; } }
public int tb_goodUpdate(tb_GoodsInfo good, string goodid) { int intFalg = 0; try { string str_Update = "update tb_GoodsInfo set "; str_Update += "GoodId='" + good.strGoodsId + "', "; str_Update += "Goodname='" + good.strGoodsName + "',"; str_Update += "ItemNO='" + good.strItemNO + "',"; str_Update += "ModelNO= '" + good.strModelNO + "',GoodMaterial='" + good.strGoodMaterial + "',FImagePath ='" + good.strFImagePath + "'"; str_Update += " where GoodId='" + goodid + "'"; intFalg = dbc.ExeInfochange(str_Update); return(intFalg); // conn.Dispose(); //return intFalg; } catch (Exception ee) { MessageBox.Show(ee.ToString()); return(intFalg); } }
private void tbGoodsname_TextChanged(object sender, EventArgs e) { if (tbGoodsname.Text.Trim() != "" && tbCarno.Text.Trim() != "" && cmbkilnno.Text.Trim() != "") { try { //tbGoodsname.Items.Clear(); string sql = "select JCGoodsID,JCItemID,JCModelno,JCHGSL,id,JCGoodsName,JCCarNO from tb_jch a" + " where jcgoodsname = '" + tbGoodsname.Text.Trim() + "' and jccarno = '" + tbCarno.Text.Trim() + "'and FKilnNO = '" + cmbkilnno.SelectedValue.ToString().Trim() + "' and jctype = 0 " + " and not exists (select 1 from tb_jch where a.id = FZYID )"; DataSet ds = dbl.GetDataset(sql); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { //tbGoodsname.Items.Add(ds.Tables[0].Rows[i][1].ToString()); tbgoodsid.Text = ds.Tables[0].Rows[i][0].ToString(); tbitemid.Text = ds.Tables[0].Rows[i][1].ToString(); tbModel.Text = ds.Tables[0].Rows[i][2].ToString(); tbryhgsl.Value = Convert.ToInt16(ds.Tables[0].Rows[i][3]); tbhgsl.Value = tbryhgsl.Value; fzyid = Convert.ToInt32(ds.Tables[0].Rows[i][4]); } } } } else { tb_GoodsInfo tbgood = new tb_GoodsInfo(); tb_GoodsInfoMethods tbgoodmethod = new tb_GoodsInfoMethods(); tbgood = tbgoodmethod.Find(tbGoodsname.Text.Trim()); if (tbgood != null) { tbgoodsid.Text = tbgood.strGoodsId; tbitemid.Text = tbgood.strItemNO; tbModel.Text = tbgood.strModelNO; tbryhgsl.Value = 0; } else { tbgoodsid.Text = ""; tbitemid.Text = ""; tbModel.Text = ""; tbryhgsl.Value = 0; } fzyid = 0; tbhgsl.Value = 0; tbpssl.Value = 0; tbghsl.Value = 0; tbklsl.Value = 0; tbhgl.Value = 0; } } catch (Exception) { throw; } } tb_GoodsInfo goods; tb_GoodsInfoMethods goodsmethod = new tb_GoodsInfoMethods(); if (tbGoodsname.Text != "") { goods = goodsmethod.Find(tbGoodsname.Text.Trim()); //tbGoodsname.Text = goods.strGoodsName; //tbgoodsid.Text = goods.strGoodsId; //tbModel.Text = goods.strModelNO; //tbitemid.Text = goods.strItemNO; // tbMaterial.Text = goods.strGoodMaterial; if (goods.strFImagePath != null) { pictureBox1.ImageLocation = goods.strFImagePath; } } else { tbgoodsid.Text = ""; tbModel.Text = ""; tbitemid.Text = ""; tbMaterial.Text = ""; pictureBox1.ImageLocation = null; tbhgsl.Value = 0; tbpssl.Value = 0; tbklsl.Value = 0; tbghsl.Value = 0; } }