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 cmbColor_Leave(object sender, EventArgs e) { tb_ColorInfo color = new tb_ColorInfo(); tb_ColorInfoMethod colorM = new tb_ColorInfoMethod(); if (cmbColor.SelectedValue != null) { color = colorM.Find(cmbColor.SelectedValue.ToString()); tbfcolorsteps.SelectedValue = color.strFColorSteps == null ? "" : color.strFColorSteps; } else { tbfcolorsteps.Text = ""; } }