コード例 #1
0
ファイル: frmWareIn.cs プロジェクト: Alencc2015/Myc-
        private void tbGoodsname_Leave(object sender, EventArgs e)
        {
            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;
                pictureBox1.ImageLocation = goods.strFImagePath;
            }
            else
            {
                tbgoodsid.Text = "";
                tbModel.Text   = "";
                tbitemid.Text  = "";
                //tbMaterial.Text = "";
                pictureBox1.Image = null;

                /*tbhgsl.Value = 0;
                 * tbpssl.Value = 0;
                 * tbklsl.Value = 0;
                 * tbghsl.Value = 0;
                 */
            }
        }
コード例 #2
0
ファイル: frmJCHEx.cs プロジェクト: Alencc2015/Myc-
        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;
            }
        }