private void textEditDocumento_EditValueChanged(object sender, EventArgs e) { BaseEdit edit = (BaseEdit)sender; if (edit.Text == "" || edit.Text == null || edit.Text.Length < 8) { return; } //Utiles.Utiles util = new Utiles.Utiles(); socionegocioSeleccionado = facturaServicio.buscarSocioNegocio(edit.Text); if (socionegocioSeleccionado == null) { DialogResult resultado = XtraMessageBox.Show("El cliente con documento " + edit.EditValue + " no existe. Desea crearlo?", "AtenciĆ³n", MessageBoxButtons.YesNo); if (resultado == System.Windows.Forms.DialogResult.Yes) { FormDatoCliente formDatoCliente = new FormDatoCliente(edit.Text); formDatoCliente.ShowDialog(); if (formDatoCliente.DialogResult == DialogResult.OK) { socionegocioSeleccionado = formDatoCliente.DatoCliente; } } else { socionegocioSeleccionado = new SOCIONEGOCIO(); } } bindingSourceSocioNegocio.DataSource = socionegocioSeleccionado; }
private void textEditDocumento_EditValueChanged(object sender, EventArgs e) { BaseEdit baseEdit = (BaseEdit)sender; if (baseEdit.Text == "" || baseEdit.Text == null || baseEdit.Text.Length < 8) { return; } this.socionegocioSeleccionado = this.facturaServicio.buscarSocioNegocio(baseEdit.Text, this.codigoEmpresa); if (this.socionegocioSeleccionado == null) { if (XtraMessageBox.Show("El cliente con documento " + baseEdit.EditValue + " no existe. Desea crearlo?", "AtenciĆ³n", MessageBoxButtons.YesNo) == DialogResult.Yes) { FormDatoCliente formDatoCliente = new FormDatoCliente(baseEdit.Text); int num = (int)formDatoCliente.ShowDialog(); if (formDatoCliente.DialogResult == DialogResult.OK) { this.socionegocioSeleccionado = formDatoCliente.DatoCliente; } } else { this.socionegocioSeleccionado = new SOCIONEGOCIO(); } } if (this.socionegocioSeleccionado != null) { this.bindingSourceSocioNegocio.DataSource = (object)this.socionegocioSeleccionado; } }
private void buttonCliente_Click(object sender, EventArgs e) { FormDatoCliente formaCliente = new FormDatoCliente(); formaCliente.Show(); }