private void btnGrabar_Click(object sender, EventArgs e) { ClienteBE oBE = new ClienteBE(); ClienteBR oBR = new ClienteBR(); oBE.proy_oid_proy = EMMA.BE.Global.oid_proy; oBE.val_deno_soci = txtDenoSoci.Text; oBE.val_nom1 = txtNom1.Text; oBE.val_nom2 = txtNom2.Text; oBE.val_ape1 = txtApe1.Text; oBE.val_ape2 = txtApe2.Text; oBE.val_nume_docu_iden = txtNumDocuIden.Text; DataRowView rv = cboTipoDocuIden.SelectedItem as DataRowView; oBE.tipo_cod_tipo_docu_iden = rv["Codigo"].ToString(); if (mod == "C") { oBR.Insertar(oBE); } else { oBE.oid_clie = Int32.Parse(txtOid.Text); oBR.Actualizar(oBE); } oFrm.CargarDGV(); this.Close(); }
private void btnEliminar_Click(object sender, EventArgs e) { ClienteBR oBR = new ClienteBR(); if (dgv.RowCount > 0) { int oid = new int(); if (dgv.RowCount > 1) { oid = int.Parse(dgv.Rows[dgv.SelectedRows[0].Index].Cells[0].Value.ToString()); } else { oid = int.Parse(dgv.Rows[0].Cells[0].Value.ToString()); } if (DialogResult.Yes == MessageBox.Show("¿ Esta seguro que desea eliminar el cliente ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { oBR.Eliminar(oid); CargarDGV(); MessageBox.Show("Cliente Eliminado"); } } else { MessageBox.Show("Debe Seleccionar un Tipo de Documento de Identidads"); } }
public void CargarDGV() { ClienteBR oClienteBR = new ClienteBR(); dt = oClienteBR.ObtenerListado(); dgv.DataSource = dt; }
public FrmReporteValorizacion() { InitializeComponent(); CHelper oCHelper = new CHelper(); oCHelper.FormatearFormularioMantenimiento(this); ClienteBR oBRCliente = new ClienteBR(); DataTable dt = new DataTable(); dt = oBRCliente.ObtenerListadoCombo(); cboCliente.DataSource = dt; cboCliente.DisplayMember = "Descripcion"; }
private void CargarClientes() { try { ClienteBR oBRCliente = new ClienteBR(); DataTable dt = new DataTable(); dt = oBRCliente.ObtenerListadoPorProyecto(Global.oid_proy); cboCliente.DataSource = dt; cboCliente.DisplayMember = "Descripcion"; } catch { cboCliente.DataSource = null; } }
/* * public FrmProyectoAdd(FrmProyecto p_oFrm): this() * { * this.oFrm = p_oFrm; * txtOid.Visible = false; * * txtOid.ReadOnly = false; * txtDescripcion.ReadOnly = false; * * this.mod = "C"; * } */ public FrmProyectoAdd(FrmProyecto p_oFrm, int p_oid, string mod) : this() { this.oFrm = p_oFrm; this.oid = p_oid; this.mod = mod; CHelper oCHelper = new CHelper(); oCHelper.FormatearFormularioMantenimientoAdd(this); ClienteBR oBRCliente = new ClienteBR(); DataTable dt = new DataTable(); dt = oBRCliente.ObtenerListadoCombo(); cboCliente.DataSource = dt; cboCliente.DisplayMember = "Descripcion"; switch (this.mod) { case "C": txtOid.Visible = true; txtOid.ReadOnly = true; txtDescripcion.ReadOnly = false; txtDepartamento.ReadOnly = false; txtProvincia.ReadOnly = false; txtDistrito.ReadOnly = false; break; case "U": txtOid.Visible = true; txtOid.ReadOnly = true; txtDescripcion.ReadOnly = false; txtDepartamento.ReadOnly = false; txtProvincia.ReadOnly = false; txtDistrito.ReadOnly = false; ClienteBE oBE = new ClienteBE(); ClienteBR oBR = new ClienteBR(); TipoDocumentoIdentidadBE oBETipoDocumento = new TipoDocumentoIdentidadBE(); TipoDocumentoIdentidadBR oBRTipoDocumento = new TipoDocumentoIdentidadBR(); oBE = oBR.obtenerClienteByOid(oid); txtOid.Text = oBE.oid_clie.ToString(); txtDescripcion.Text = oBE.val_deno_soci; /* * txtNumDocuIden.Text = oBE.val_nume_docu_iden; * * txtNom1.Text = oBE.val_nom1; * txtNom2.Text = oBE.val_nom2; * txtApe1.Text = oBE.val_ape1; * txtApe2.Text = oBE.val_ape2; * * oBETipoDocumento = oBRTipoDocumento.obtenerTipoDocumentoIdentidadByCod(oBE.tipo_cod_tipo_docu_iden); * cboTipoDocuIden.SelectedIndex = cboTipoDocuIden.FindStringExact(oBETipoDocumento.val_desc); */ break; case "R": txtOid.Visible = true; txtOid.ReadOnly = true; txtDescripcion.ReadOnly = true; txtDepartamento.ReadOnly = true; txtProvincia.ReadOnly = true; txtDistrito.ReadOnly = true; break; } }
/* * public FrmComensalAdd(FrmComensal p_oFrm): this() * { * this.oFrm = p_oFrm; * txtOid.Visible = false; * * txtOid.ReadOnly = false; * txtDenoSoci.ReadOnly = false; * * this.mod = "C"; * } */ public FrmComensalAdd(FrmComensal p_oFrm, int p_oid, string mod) : this() { this.oFrm = p_oFrm; this.oid = p_oid; this.mod = mod; CHelper oCHelper = new CHelper(); oCHelper.FormatearFormularioMantenimientoAdd(this); txtProyecto.Text = Global.des_proy; ClienteBR oBRCliente = new ClienteBR(); DataTable dt = new DataTable(); dt = oBRCliente.ObtenerListadoPorProyecto(Global.oid_proy); cboCliente.DataSource = dt; cboCliente.DisplayMember = "Descripcion"; TipoDocumentoIdentidadBR oBRTipo = new TipoDocumentoIdentidadBR(); dt = oBRTipo.ObtenerListado(); cboTipoDocuIden.DataSource = dt; cboTipoDocuIden.DisplayMember = "Descripcion"; ComensalBR oBRComensal = new ComensalBR(); dt = oBRComensal.ObtenerComedoresAtencion(p_oid); //dgvComedoresAtencion.DataSource = dt; int i = 0; foreach (DataRow dr in dt.Rows) { DataGridViewRow rowDGV = (DataGridViewRow)dgvComedoresAtencion.Rows[0].Clone(); rowDGV.Cells[0].Value = dr.Field <int>(0); rowDGV.Cells[1].Value = dr.Field <string>(1); dgvComedoresAtencion.Rows.Add(rowDGV); i = 1 + 1; } switch (this.mod) { case "C": txtOid.Visible = true; txtOid.ReadOnly = true; txtDescripcion.ReadOnly = false; txtNumeroIdentificacionComedor.ReadOnly = false; txtCargo.ReadOnly = false; break; case "U": txtOid.Visible = true; txtOid.ReadOnly = true; txtDescripcion.ReadOnly = false; ComensalBE oBE = new ComensalBE(); ComensalBR oBR = new ComensalBR(); oBE = oBR.obtenerComensalByOid(oid); txtOid.Text = oBE.oid_come.ToString(); TipoDocumentoIdentidadBE oBETipoDocumento = new TipoDocumentoIdentidadBE(); TipoDocumentoIdentidadBR oBRTipoDocumento = new TipoDocumentoIdentidadBR(); oBETipoDocumento = oBRTipoDocumento.obtenerTipoDocumentoIdentidadByCod(oBE.tipo_cod_tipo_docu_iden); cboTipoDocuIden.SelectedIndex = cboTipoDocuIden.FindStringExact(oBETipoDocumento.val_desc); txtNumeroIdentificacionComedor.Text = oBE.num_iden_come; txtDescripcion.Text = oBE.val_desc; txtNumDocuIden.Text = oBE.val_num_docu_iden; txtCargo.Text = oBE.val_carg; txtTipoCargo.Text = oBE.val_tipo_carg; break; case "R": txtOid.Visible = true; txtOid.ReadOnly = true; txtDescripcion.ReadOnly = true; break; } }