private void btn_aplicar_filtro_empresa_Click(object sender, EventArgs e) { Persona per = new Persona(); if (txt_apellido.Text != "") { per.Apellido = txt_apellido.Text; } if (txt_nombre.Text != "") { per.Nombre = txt_nombre.Text; } if (txt_nro_doc.Text != "") { per.NroDoc = Convert.ToInt64(txt_nro_doc.Text); } per.TipoDoc = new TipoDocumento() { IDTipoDoc = (int)cmb_tipo_doc.SelectedValue }; if (txt_razon_social.Text != "") { per.RazonSocial = txt_razon_social.Text; } if (txt_cuit.Text != " - -") { per.cuil = txt_cuit.Text; } List <Persona> resul = null; try { resul = GestorDeFiltros.filtrarCliente(per); } catch (ApplicationException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } if (resul.Count == 1) { Persona res = resul.ElementAt <Persona>(0); txt_apellido.Text = res.Apellido; txt_nombre.Text = res.Nombre; txt_nro_doc.Text = res.NroDoc.ToString(); txt_razon_social.Text = res.RazonSocial; cmb_tipo_doc.SelectedValue = res.TipoDoc.IDTipoDoc; txt_celular.Text = res.tefefonoCelular.ToString(); } else { ResultadoDeFiltro resFiltro = new ResultadoDeFiltro(); resFiltro._resultado = resul; resFiltro.ShowDialog(); Persona res = Vista.iniciador.per; resultado = res; if (res != null) { txt_apellido.Text = res.Apellido; txt_nombre.Text = res.Nombre; txt_nro_doc.Text = res.NroDoc.ToString(); txt_razon_social.Text = res.RazonSocial; cmb_tipo_doc.SelectedValue = res.TipoDoc.IDTipoDoc; txt_celular.Text = res.tefefonoCelular.ToString(); } } dtp_fecha_necesidad.Enabled = true; btn_agregar.Enabled = true; txt_cantidad.Enabled = true; dgv_productos_finales.Enabled = true; dgv_detalle.Enabled = true; }
private void btn_aplicar_filtro_empresa_Click(object sender, EventArgs e) { Persona per = new Persona(); if (txt_apellido.Text != "") { per.Apellido = txt_apellido.Text; } if (txt_nombre.Text != "") { per.Nombre = txt_nombre.Text; } if (txt_nro_doc.Text != "") { per.NroDoc = Convert.ToInt64(txt_nro_doc.Text); } per.TipoDoc = new TipoDocumento() { IDTipoDoc = (int)cmb_tipo_doc.SelectedValue }; if (txt_razon_social.Text != "") { per.RazonSocial = txt_razon_social.Text; } if (txt_cuit.Text != " - -") { per.cuil = txt_cuit.Text; } List<Persona> resul = null; try { resul = GestorDeFiltros.filtrarCliente(per); } catch (ApplicationException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } if (resul.Count == 1) { Persona res = resul.ElementAt<Persona>(0); txt_apellido.Text = res.Apellido; txt_nombre.Text = res.Nombre; txt_nro_doc.Text = res.NroDoc.ToString(); txt_razon_social.Text = res.RazonSocial; cmb_tipo_doc.SelectedValue = res.TipoDoc.IDTipoDoc; txt_celular.Text = res.tefefonoCelular.ToString(); } else { ResultadoDeFiltro resFiltro = new ResultadoDeFiltro(); resFiltro._resultado = resul; resFiltro.ShowDialog(); Persona res = Vista.iniciador.per; resultado = res; if (res != null) { txt_apellido.Text = res.Apellido; txt_nombre.Text = res.Nombre; txt_nro_doc.Text = res.NroDoc.ToString(); txt_razon_social.Text = res.RazonSocial; cmb_tipo_doc.SelectedValue = res.TipoDoc.IDTipoDoc; txt_celular.Text = res.tefefonoCelular.ToString(); } } dtp_fecha_necesidad.Enabled = true; btn_agregar.Enabled = true; txt_cantidad.Enabled = true; dgv_productos_finales.Enabled = true; dgv_detalle.Enabled = true; }
private void btn_aplicar_filtro_empresa_Click(object sender, EventArgs e) { Persona per = new Persona(); if (txt_apellido.Text != "") { per.Apellido = txt_apellido.Text; } if (txt_nombre.Text != "") { per.Nombre = txt_nombre.Text; } if (txt_cuit.Text != " - -") { per.cuil = txt_cuit.Text; } if (txt_razon_social.Text != "") { per.RazonSocial = txt_razon_social.Text; } List <Persona> resul = null; try { resul = PersonaDAO.GetByFiltro(per); } catch (ApplicationException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } if (resul.Count == 1) { res = resul.ElementAt <Persona>(0); txt_apellido.Text = res.Apellido; txt_nombre.Text = res.Nombre; txt_razon_social.Text = res.RazonSocial; cmb_iva.SelectedValue = res.condicionIVA.idCondicionIVA; txt_cuit.Text = res.cuil; } else { ResultadoDeFiltro resFiltro = new ResultadoDeFiltro(); resFiltro._resultado = resul; resFiltro.ShowDialog(); res = Vista.iniciador.per; resultado = res; if (res != null) { txt_apellido.Text = res.Apellido; txt_nombre.Text = res.Nombre; txt_razon_social.Text = res.RazonSocial; txt_cuit.Text = res.cuil; cmb_iva.SelectedValue = res.condicionIVA.idCondicionIVA; } } btn_agregar.Enabled = true; txt_cantidad.Enabled = true; dgv_productos_finales.Enabled = true; dgv_detalle.Enabled = true; }
private void btn_aplicar_filtro_empresa_Click(object sender, EventArgs e) { Persona per = new Persona(); if (txt_apellido.Text != "") { per.Apellido = txt_apellido.Text; } if (txt_nombre.Text != "") { per.Nombre = txt_nombre.Text; } if (txt_cuit.Text != " - -") { per.cuil = txt_cuit.Text; } if (txt_razon_social.Text != "") { per.RazonSocial = txt_razon_social.Text; } List<Persona> resul = null; try { resul = PersonaDAO.GetByFiltro(per); } catch (ApplicationException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } if (resul.Count == 1) { res = resul.ElementAt<Persona>(0); txt_apellido.Text = res.Apellido; txt_nombre.Text = res.Nombre; txt_razon_social.Text = res.RazonSocial; cmb_iva.SelectedValue = res.condicionIVA.idCondicionIVA; txt_cuit.Text = res.cuil; } else { ResultadoDeFiltro resFiltro = new ResultadoDeFiltro(); resFiltro._resultado = resul; resFiltro.ShowDialog(); res = Vista.iniciador.per; resultado = res; if (res != null) { txt_apellido.Text = res.Apellido; txt_nombre.Text = res.Nombre; txt_razon_social.Text = res.RazonSocial; txt_cuit.Text = res.cuil; cmb_iva.SelectedValue = res.condicionIVA.idCondicionIVA; } } btn_agregar.Enabled = true; txt_cantidad.Enabled = true; dgv_productos_finales.Enabled = true; dgv_detalle.Enabled = true; }