private void btnGrabar_Click(object sender, EventArgs e) { ComedorAtencionBE oBE = new ComedorAtencionBE(); ComedorAtencionBR oBR = new ComedorAtencionBR(); oBE.proy_oid_proy = Global.oid_proy; oBE.val_desc = txtDescripcion.Text; if ((cboEstado.SelectedItem as ComboBoxItem).Value.ToString() == "1") { oBE.ind_acti = 1; } else { oBE.ind_acti = 0; }; if (mod == "C") { oBR.Insertar(oBE); } else { oBE.oid_come_aten = Int32.Parse(txtOid.Text); oBR.Actualizar(oBE); } oFrm.CargarDGV(); this.Close(); }
private void btnEliminar_Click(object sender, EventArgs e) { ComedorAtencionBR oBR = new ComedorAtencionBR(); 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()); } oBR.Eliminar(oid); CargarDGV(); MessageBox.Show("Comedor Eliminado"); } else { MessageBox.Show("Debe Seleccionar un Comedor"); } }
public void CargarDGV() { ComedorAtencionBR oComedorAtencionBR = new ComedorAtencionBR(); dt = oComedorAtencionBR.ObtenerListado(); dgv.DataSource = dt; dgv.Columns[0].Visible = false; }
/* * public FrmComedorTipoServicioAdd(FrmComedorTipoServicio p_oFrm): this() * { * this.oFrm = p_oFrm; * txtOid.Visible = false; * * txtOid.ReadOnly = false; * txtDescripcion.ReadOnly = false; * * this.mod = "C"; * } */ public FrmComedorTipoServicioAdd(FrmComedorTipoServicio 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; DataTable dt = new DataTable(); ComedorAtencionBR oComedorAtencionBR = new ComedorAtencionBR(); dt = oComedorAtencionBR.ObtenerListadoPorProyecto(Global.oid_proy); cboComedor.DataSource = dt; cboComedor.DisplayMember = "Descripcion"; TipoServicioComedorBR oBRTipoServicioComedor = new TipoServicioComedorBR(); DataTable dt2 = new DataTable(); dt2 = oBRTipoServicioComedor.ObtenerListadoCombo(); cboTipoServicio.DataSource = dt2; cboTipoServicio.DisplayMember = "Descripcion"; CargarComboEstado(); switch (this.mod) { case "C": txtOid.Visible = true; txtOid.ReadOnly = true; break; case "U": txtOid.Visible = true; txtOid.ReadOnly = true; break; case "R": txtOid.Visible = true; txtOid.ReadOnly = true; break; } }
public FrmComensalComedorAtencionAdd(FrmComensalAdd p_oFrm, int proy_oid_proy) : this() { oFrm = p_oFrm; ComedorAtencionBR oBRComedor = new ComedorAtencionBR(); DataTable dt = new DataTable(); dt = oBRComedor.ObtenerListadoPorProyecto(proy_oid_proy); cboComedor.DataSource = dt; cboComedor.DisplayMember = "Descripcion"; }
private void cboProyecto_SelectedIndexChanged(object sender, EventArgs e) { ComedorAtencionBR oBRComedor = new ComedorAtencionBR(); DataTable dt = new DataTable(); DataRowView rv = cboProyecto.SelectedItem as DataRowView; int oid_proy; oid_proy = Int32.Parse(rv["Codigo"].ToString()); dt = oBRComedor.ObtenerListadoPorProyecto(oid_proy); cboComedor.DataSource = dt; cboComedor.DisplayMember = "Descripcion"; }
private void CargarComedores() { try { ComedorAtencionBR oBRComedor = new ComedorAtencionBR(); DataTable dt = new DataTable(); int oid_proy; oid_proy = Global.oid_proy; dt = oBRComedor.ObtenerListadoPorProyecto(oid_proy); cboComedor.DataSource = dt; cboComedor.DisplayMember = "Descripcion"; } catch { cboComedor.DataSource = null; } }
/* * public FrmTurnoAdd(FrmTurno p_oFrm): this() * { * this.oFrm = p_oFrm; * txtOid.Visible = false; * * txtOid.ReadOnly = false; * txtDescripcion.ReadOnly = false; * * this.mod = "C"; * } */ public FrmTurnoAdd(FrmTurno 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; switch (this.mod) { case "C": txtOid.Visible = true; txtOid.ReadOnly = true; //dtpFecha.ReadOnly = false; ComedorAtencionBR oBRComedorAtencion = new ComedorAtencionBR(); DataTable dt = new DataTable(); dt = oBRComedorAtencion.ObtenerListadoPorProyecto(Global.oid_proy); cboComedor.DataSource = dt; cboComedor.DisplayMember = "Descripcion"; break; case "U": txtOid.Visible = true; txtOid.ReadOnly = true; //dtpFecha.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(); * txtDenoSoci.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; break; } }
/* * public FrmLectoraAdd(FrmLectora p_oFrm): this() * { * this.oFrm = p_oFrm; * txtOid.Visible = false; * * txtOid.ReadOnly = false; * txtDescripcion.ReadOnly = false; * * this.mod = "C"; * } */ public FrmLectoraAdd(FrmLectora 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; DataTable dt = new DataTable(); ComedorAtencionBR oComedorAtencionBR = new ComedorAtencionBR(); dt = oComedorAtencionBR.ObtenerListadoPorProyecto(Global.oid_proy); cboComedor.DataSource = dt; cboComedor.DisplayMember = "Descripcion"; ComboBoxItem itemActivo = new ComboBoxItem(); itemActivo.Text = "Activo"; itemActivo.Value = 1; cboEstado.Items.Add(itemActivo); ComboBoxItem itemInactivo = new ComboBoxItem(); itemInactivo.Text = "Inactivo"; itemInactivo.Value = 0; cboEstado.Items.Add(itemInactivo); cboEstado.SelectedIndex = 0; switch (this.mod) { case "C": txtOid.Visible = true; txtOid.ReadOnly = true; txtDescripcion.ReadOnly = false; break; case "U": txtOid.Visible = true; txtOid.ReadOnly = true; txtDescripcion.ReadOnly = false; break; case "R": txtOid.Visible = true; txtOid.ReadOnly = true; txtDescripcion.ReadOnly = true; break; } }