コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }