Exemplo n.º 1
0
        private CategoriaIngreso CategoriaIngreso_ControlAClase()
        {
            CategoriaIngreso ingreso = new CategoriaIngreso();

            ingreso.Nombre = txtNombre.Text.Trim();
            return(ingreso);
        }
Exemplo n.º 2
0
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     if (!Validar())
     {
         CategoriaIngreso   fuente          = CategoriaIngreso_ControlAClase();
         CategoriaIngresoDB fuenteIngresoDB = new CategoriaIngresoDB();
         if (fuenteIngresoDB.Agregar_Modificar(fuente, ClinicaPro.General.accion.Agregar) != IdVacia)
         {
             Limpiar();
         }
     }
 }
Exemplo n.º 3
0
 private void btnActualizar_Click(object sender, EventArgs e)
 {
     if (!Validar())
     {
         if (dgFuente.SelectedRows.Count == 1)
         {
             this.IdCategoriaIngreso = (byte)dgFuente.CurrentRow.Cells[comboNombreIDs.CategoriaIngreso].Value;
         }
         CategoriaIngreso fuente = CategoriaIngreso_ControlAClase();
         fuente.IdCategoriaIngreso = this.IdCategoriaIngreso;
         CategoriaIngresoDB fuenteIngresoDB = new CategoriaIngresoDB();
         if (fuenteIngresoDB.Agregar_Modificar(fuente, ClinicaPro.General.accion.Modificar) != IdVacia)
         {
             Limpiar();
             MensajeDeActulizacion();
         }
         else
         {
             MessageBox.Show(Mensajes.No_Se_Actualizo + "\n" + Mensajes.Refresh, Mensajes.AlgoPaso, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }