private void BtnActualizar_Click(object sender, EventArgs e) { try { if (this.validacionImgError()) { this.convertir(); EAtencion Obj = new EAtencion(); Obj.atencionID = Convert.ToInt32(this.txtId.Text); Obj.pacienteID = Convert.ToInt32(this.txtidpaciente.Text); Obj.odontologoID = Convert.ToInt32(this.txtIdOdontologo.Text); Obj.empleadoID = empleado.usuarioID; Obj.hora = this.txtHora.Value.TimeOfDay; Obj.importe = Convert.ToDecimal(this.txtImporte.Text); Obj.descripcion = this.txtDescripcion.Text.Trim(); Obj.tipo = this.tipo; NAtencion.update(Obj); this.MostrarDB(); this.LimpiarPRegistro(); } else { throw new Exception("Datos Obligatorios"); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Sistema Odontograma"); } }
private void MostrarDB() { this.dataListado.DataSource = NAtencion.mostrar(this.siguientePag); this.ordenarColumnas(); this.dataListado.AutoResizeColumns(); int dataTotal = NAtencion.mostrarTotal() / 5; if (dataTotal == 0) { this.btnIncio.Enabled = false; this.btnAtras.Enabled = false; this.btnFin.Enabled = false; this.btnSiguiente.Enabled = false; } else { if (dataTotal == siguientePag) { this.btnIncio.Enabled = true; this.btnAtras.Enabled = true; this.btnFin.Enabled = false; this.btnSiguiente.Enabled = false; } else { if (Convert.ToInt32(this.siguientePag) > 0) { this.btnAtras.Enabled = true; this.btnIncio.Enabled = true; this.btnFin.Enabled = true; this.btnSiguiente.Enabled = true; } else { this.btnIncio.Enabled = false; this.btnAtras.Enabled = false; this.btnFin.Enabled = true; this.btnSiguiente.Enabled = true; } } } lblTotal.Text = "Total de Registros: " + Convert.ToString(dataListado.Rows.Count); }
private void FrmReporteCitaRango_Load(object sender, EventArgs e) { this.reportViewer1.LocalReport.DataSources.Clear(); this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetAtencion", NAtencion.mostrarReporteAtencionRango(fecha1, fecha2))); this.reportViewer1.RefreshReport(); }
private void BtnFin_Click(object sender, EventArgs e) { this.siguientePag = NAtencion.mostrarTotal() / 10; this.MostrarDB(); }
private void DataListado_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dataListado.Columns["Eliminar"].Index) { DialogResult Opcion; Opcion = MessageBox.Show("Realmente desea Eliminar El Registro", "Sistema de Ventas", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (Opcion == DialogResult.OK) { string Codigo; string Rpta = ""; Codigo = Convert.ToString(this.dataListado.CurrentRow.Cells["atencionID"].Value); EAtencion Obj = new EAtencion(); Obj.atencionID = Convert.ToInt32(Codigo); Rpta = Convert.ToString(NAtencion.delete(Obj)); if (Rpta.Equals("OK")) { this.MensajeOk("Se ELimino Correctamente el Registro"); } else { this.MensajeError(Rpta); } this.MostrarDB(); } } if (e.ColumnIndex == dataListado.Columns["Editar"].Index) { this.LimpiarPRegistro(); this.txtId.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["atencionID"].Value); this.txtidpaciente.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["pacienteID"].Value); this.txtIdOdontologo.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["odontologoID"].Value); this.txtpaciente.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["paciente"].Value); this.txtOdontologo.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["odontologo"].Value); this.txtEmpleado.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["empleado"].Value); this.txtHora.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["hora"].Value); this.txtDescripcion.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["descripcion"].Value); this.txtImporte.Text = Convert.ToString(this.dataListado.CurrentRow.Cells["importe"].Value); this.tipo = Convert.ToString(this.dataListado.CurrentRow.Cells["tipo"].Value); if (this.tipo == "consulta") { this.chConsulta.Checked = true; } else { this.chTratamiento.Checked = true; } ///LOCA this.OcultarPRegistro(false, false); this.lbModificar.Visible = true; this.lbAgregar.Visible = false; this.txtidpaciente.Visible = false; this.txtIdOdontologo.Visible = false; } if (e.ColumnIndex == dataListado.Columns["imprimir"].Index) { } }