private void FormCardCategoryDetail_Shown(object sender, EventArgs e) { DataTable dt = ServiceCardBrand.queryAll(); lookUpEditBrand.Properties.DataSource = dt; lookUpEditBrand.Properties.DisplayMember = "BrandName"; lookUpEditBrand.Properties.ValueMember = "BrandId"; lookUpEditBrand.EditValue = brandId; lookUpEditBrand.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False; }
private void btnSave_Click(object sender, EventArgs e) { try { if (String.IsNullOrEmpty(this.brandIdTextBox.Text)) { //新增 ServiceCardBrand.insert(this.brandNameTextBox.Text.Trim()); } else { //新增 ServiceCardBrand.update(this.brandIdTextBox.Text, this.brandNameTextBox.Text.Trim()); } DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } catch (Exception ex) { YYMessageBox.Show(ex); } }