/// <summary> /// 绑定物料代码。 /// </summary> private void BindMaterialCode() { ReceiveMaterialEntity entity = new ReceiveMaterialEntity(); DataSet ds = entity.GetMaterials(); if (string.IsNullOrEmpty(entity.ErrorMsg)) { this._dtMaterial = ds.Tables[0]; this.cmbMaterialCode.Properties.Items.Clear(); foreach (DataRow dr in this._dtMaterial.Rows) { string materialCode = Convert.ToString(dr["MATERIAL_CODE"]); if (!string.IsNullOrEmpty(materialCode)) { this.cmbMaterialCode.Properties.Items.Add(materialCode); } } } else { MessageService.ShowError(entity.ErrorMsg); } }
/// <summary> /// 绑定物料编码。 /// </summary> private void BindMaterialCode() { string orderNumber = this.lueWorkOrderNo.Text; this.lueMaterialCode.EditValue = string.Empty; this.txtMaterialDescription.Text = string.Empty; ReceiveMaterialEntity entity = new ReceiveMaterialEntity(); DataSet ds = entity.GetMaterials(orderNumber); if (string.IsNullOrEmpty(entity.ErrorMsg)) { this.lueMaterialCode.Properties.DataSource = ds.Tables[0]; this.lueMaterialCode.Properties.DisplayMember = "MATERIAL_CODE"; this.lueMaterialCode.Properties.ValueMember = "MATERIAL_KEY"; this.lueMaterialCode.ItemIndex = 0; } else { this.lueMaterialCode.Properties.DataSource = null; this.lueMaterialCode.EditValue = string.Empty; this.txtMaterialDescription.Text = string.Empty; } }