private void cboSupplier_EditValueChanged(object sender, EventArgs e) { DevExpress.XtraEditors.LookUpEdit editor = sender as DevExpress.XtraEditors.LookUpEdit; txtAddress.Text = editor.GetColumnValue("Address").ToString(); }
private void btnUpdate_Click(object sender, System.EventArgs e) { if (luePO.EditValue == null) { Popup.ShowPopup("No PO has been selected."); return; } if (lueSupplier.EditValue == null) { Popup.ShowPopup("No replacement Supplier has been selected."); return; } if (Popup.ShowPopup("Are you sure you want to change the supplier on this PO?", frmPopup.PopupType.OK_Cancel) == frmPopup.PopupResult.OK) { string sUpdate = "declare @supplier_id int " + "select @supplier_id=supplier_id from SUPPLIER_MASTER where SUPPLIER='" + lueSupplier.EditValue + "' " + "update po_header set supplier='" + lueSupplier.EditValue + "', supp_name='" + lueSupplier.GetColumnValue("NAME").ToString().Replace("'", "''") + "' where po_id=" + luePO.EditValue + " " + "update so_tasks set vendor=@supplier_id, vendor_description='" + lueSupplier.GetColumnValue("NAME").ToString().Replace("'", "''") + "' where id in (select so_task_id from po_detail where so_task_id is not null and po_id=" + luePO.EditValue + ")"; Connection.SQLExecutor.ExecuteNonQuery(sUpdate, Connection.TRConnection); this.DialogResult = DialogResult.OK; this.Close(); } }