private void tbmodelno_Leave(object sender, EventArgs e) { tb_ModelInfo model = new tb_ModelInfo(); tb_ModelInfoMethod modeMethod = new tb_ModelInfoMethod(); if (tbgoodname.Enabled) { if (tbgoodname.Text != "") { model = modeMethod.Find(tbgoodname.Text); tbmono.Text = model.strModelNo; tbftypestep1.SelectedValue = model.strFTypeSteps1 == null ? "" : model.strFTypeSteps1; tbftypestep2.SelectedValue = model.strFTypeSteps2 == null ? "" : model.strFTypeSteps2; tbftypestep3.SelectedValue = model.strFTypeSteps3 == null ? "" : model.strFTypeSteps3; //tbfcolorsteps.SelectedValue = model.str pictureBox1.ImageLocation = model.strFImagePath; tbmqty.Text = model.strFMaterialQty; } else { //tbModelNo1.Text = ""; tbftypestep1.Text = ""; tbftypestep2.Text = ""; tbftypestep3.Text = ""; pictureBox1.ImageLocation = ""; tbmqty.Text = ""; } } }
private void tbgoodid_Leave(object sender, EventArgs e) { if (isEdit == true && tbgoodid.Text.Trim() != "") { string[] IDS = tbgoodid.Text.Trim().Split('.'); if (IDS.Length > 0) { tb_ColorInfoMethod colorMethod = new tb_ColorInfoMethod(); tb_ColorInfo color = colorMethod.Find(IDS[0]); if (!string.IsNullOrEmpty(color.strColorNo)) { cmbColor.SelectedValue = color.strColorNo; cmbColor.Text = color.strColorName; if (IDS.Length > 1) { tb_ModelInfoMethod modelmethod = new tb_ModelInfoMethod(); tb_ModelInfo model = modelmethod.FindByID(IDS[1]); if (!string.IsNullOrEmpty(model.strModelNo)) { tbgoodname.SelectedValue = model.strModelNo; tbgoodname.Text = model.strModelName; tbmono.Text = model.strModelNo; tbftypestep1.SelectedValue = model.strFTypeSteps1 == null ? "" : model.strFTypeSteps1; tbftypestep2.SelectedValue = model.strFTypeSteps2 == null ? "" : model.strFTypeSteps2; tbftypestep3.SelectedValue = model.strFTypeSteps3 == null ? "" : model.strFTypeSteps3; tbmqty.Text = model.strFMaterialQty; } } } } } }
private void tbmodelno_Leave(object sender, EventArgs e) { tb_ModelInfo goods; tb_ModelInfoMethod goodsmethod = new tb_ModelInfoMethod(); if (isEdit) { if (tbmodelno.Text != "") { //goods = goodsmethod.Find(tbmodelno.Text.Trim()); string sql = "select a.FColor,b.ColorName from tb_SpGoodsInfo a " + " left join tb_ColorInfo b on a.FColor = b.ColorNo " + "where a.GoodName = '" + tbmodelno.Text.Trim() + "'"; ds = dbl.GetDatasetReport(sql, "good"); List <string> listArr = new List <string>(); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { tbMaterial.DataSource = ds.Tables[0]; tbMaterial.DisplayMember = "ColorName"; tbMaterial.ValueMember = "FColor"; } } } } else { tbgoodid.Text = ""; tbMaterial.Text = ""; //pictureBox1.ImageLocation = null; } } }