void txtPlato_Validating(object sender, CancelEventArgs e) { DevExpress.XtraEditors.TextEdit Editor = (DevExpress.XtraEditors.TextEdit) this.gridControl2.MainView.ActiveEditor; if (!Editor.IsModified) { return; } string Texto = Editor.Text; platosCombo = (PlatosCombo)this.platosComboBindingSource.Current; if (UbicarPlato(Texto)) { if (mPlato == null) { Editor.Undo(); e.Cancel = true; return; } LeerPlato(false); Editor.Text = mPlato.Descripcion; } else { LeerPlato(false); Editor.Undo(); } }
void txtIngrediente_Validating(object sender, CancelEventArgs e) { DevExpress.XtraEditors.TextEdit Editor = (DevExpress.XtraEditors.TextEdit) this.gridControl1.MainView.ActiveEditor; if (!Editor.IsModified) { return; } string Texto = Editor.Text; platoIngrediente = (PlatosIngrediente)this.platosIngredienteBindingSource.Current; if (UbicarProducto(Texto)) { if (ingrediente == null) { Editor.Undo(); e.Cancel = true; return; } LeerIngrediente(false); Editor.Text = ingrediente.Descripcion; } else { LeerIngrediente(false); Editor.Undo(); } }