Ejemplo n.º 1
0
        public void guardar()
        {
            try
            {
                if (!validar())
                {
                    return;
                }


                CONT_ENCA_PART_BORRADOR p = new CONT_ENCA_PART_BORRADOR {
                    ID = 0, FE_PARTIDA = UIFE_PARTIDA.DateTime, ID_DIARIO = int.Parse(UIID_DIARIO.EditValue.ToString()), NM_EJERCICIO = int.Parse(_datasistema.periodo.NM_EJERCICIO.ToString()), NM_PERIODO = int.Parse(_datasistema.periodo.NM_PERIODO.ToString()), DS_CONCEPTO = UIDS_CONCEPTO.Text, DS_REFERENCIA = UIDS_REFERENCIA.Text, CD_ESTA_PART = 'D', ID_PART_DIA = 0, ID_EMPRESA = _datasistema.empresa.ID
                };
                if (UIID.Text == "")
                {
                    p = manejadorData.insertar(p);
                }
                else
                {
                    p.ID = int.Parse(UIID.Text);
                    manejadorData.modificar(p);
                }
                consultar();
                MetodosForm.seleccionarFila(uigridview, "ID", p.ID);
            }
            catch (Exception ex)
            {
                MetodosForm.mensajeErrorDefault(ex.Message, _datasistema);
            }
        }
Ejemplo n.º 2
0
 public void eliminar()
 {
     try
     {
         CONT_ENCA_PART_BORRADOR p = new CONT_ENCA_PART_BORRADOR {
             ID = int.Parse(UIID.Text)
         };
         manejadorData.eliminar(p);
         consultar();
     }
     catch (Exception ex)
     {
         MetodosForm.mensajeErrorDefault(ex.Message, _datasistema);
     }
 }
Ejemplo n.º 3
0
 private void uirbn_actualizar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         CONT_ENCA_PART_BORRADOR p = new CONT_ENCA_PART_BORRADOR {
             ID = int.Parse(UIID.Text)
         };
         if (MetodosForm.preguntar("¿Quiere actualizar la partida?"))
         {
             manejadorData.actualizarPartida(p);
             consultar();
             MetodosForm.seleccionarFila(uigridview, "ID", p.ID);
         }
     }
     catch (Exception ex)
     {
         MetodosForm.mensajeErrorDefault(ex.Message, _datasistema);
     }
 }