/* * 方法名称: SetData() * 方法功能描述:更新数据时,将原数据显示在文本、下拉列表框中; * * 创建人:冯雪 * 创建时间:2009-03-26 * * 修改人: * 修改时间: * 修改内容: * */ private void SetData() { datatable = eLogic.SearchLiquidMatter(Id); if (datatable.Rows.Count == 0) { return; } else { txtHeight.Text = datatable.Rows[0]["eHeight"].ToString(); txtDiameter.Text = datatable.Rows[0]["diameter"].ToString(); cbxType.Text = datatable.Rows[0]["kind"].ToString(); cbx_yno.Text = datatable.Rows[0]["no"].ToString(); txtRemark.Text = datatable.Rows[0]["remark"].ToString(); if (datatable.Rows[0]["mId"].ToString() != "") { setMKind(); rbtnMaterial.Checked = true; dt = eLogic.searchMPInfo(Convert.ToInt64(datatable.Rows[0]["mId"].ToString()), 1); cbxKind.SelectedIndex = transportLogic.FindIndex(cbxKind, dt.Rows[0]["sort"].ToString(), "材料种类"); MLinkage(); cbxName.SelectedIndex = transportLogic.FindIndex(cbxName, dt.Rows[0]["name"].ToString(), "材料名称"); setMmodel(); cbxModel.SelectedIndex = transportLogic.FindIndex(cbxModel, dt.Rows[0]["model"].ToString(), "材料规格"); return; } if (datatable.Rows[0]["pId"].ToString() != "") { setPKind(); rbtnProduct.Checked = true; dt = eLogic.searchMPInfo(Convert.ToInt64(datatable.Rows[0]["pId"].ToString()), 2); cbxKind.SelectedIndex = transportLogic.FindIndex(cbxKind, dt.Rows[0]["sort"].ToString(), "产品种类"); PLinkage(); cbxName.SelectedIndex = transportLogic.FindIndex(cbxName, dt.Rows[0]["name"].ToString(), "产品名称"); setPmodel(); cbxModel.SelectedIndex = transportLogic.FindIndex(cbxModel, dt.Rows[0]["model"].ToString(), "产品规格"); return; } } }