Exemplo n.º 1
0
        private Recibocajaegresodet AsignarRecibocajaDetalle(VwRecibocajaegresodet vwRecibocajadet)
        {
            Recibocajaegresodet recibocajadetMnt = new Recibocajaegresodet
            {
                Idrecibocajaegreso    = IdEntidadMnt,
                Idrecibocajaegresodet = vwRecibocajadet.Idrecibocajaegresodet,
                Numeroitem            = vwRecibocajadet.Numeroitem,
                Importepago           = vwRecibocajadet.Importepago,
                Idmediopago           = vwRecibocajadet.Idmediopago,
                Numeromediopago       = vwRecibocajadet.Numeromediopago,
                Comentario            = vwRecibocajadet.Comentario,
                Idcpcompra            = vwRecibocajadet.Idcpcompra
            };

            return(recibocajadetMnt);
        }
Exemplo n.º 2
0
 public void UpdateRecibocajaegresodet(Recibocajaegresodet entity)
 {
     RecibocajaegresodetDao.Update(entity);
 }
Exemplo n.º 3
0
        private void bmMantenimiento_ItemClick(object sender, ItemClickEventArgs e)
        {
            var subMenu = e.Item as BarSubItem;

            if (subMenu != null)
            {
                return;
            }
            switch (e.Item.Name)
            {
            case "btnNuevo":
                LimpiarCampos();

                TipoMnt = TipoMantenimiento.Nuevo;

                IdEntidadMnt          = 0;
                pkIdEntidad.EditValue = 0;

                RecibocajaMnt = null;
                RecibocajaMnt = new Recibocajaegreso();

                btnGrabar.Enabled       = true;
                btnGrabarCerrar.Enabled = true;
                btnGrabarNuevo.Enabled  = true;

                btnEliminar.Enabled   = false;
                btnActualizar.Enabled = false;

                ValoresPorDefecto();

                if (Permisos.Nuevo)
                {
                    CamposSoloLectura(false);
                }
                break;

            case "btnGrabar":
                if (Guardar())
                {
                    SeGuardoObjeto = true;
                    //btnGrabar.Enabled = false;
                    //btnGrabarCerrar.Enabled = false;
                    btnGrabarNuevo.Enabled = false;

                    if (IdEntidadMnt > 0)
                    {
                        TipoMnt = TipoMantenimiento.Modificar;
                    }

                    if (Permisos.Eliminar)
                    {
                        btnEliminar.Enabled   = true;
                        btnActualizar.Enabled = true;
                    }
                    DeshabilitarModificacion();
                }
                break;

            case "btnGrabarCerrar":
                if (Guardar())
                {
                    SeGuardoObjeto = true;
                    DialogResult   = DialogResult.OK;
                }
                break;

            case "btnEliminar":
                EliminaRegistro();
                break;

            case "btnLimpiarCampos":
                LimpiarCampos();
                break;

            case "btnActualizar":
                if (IdEntidadMnt > 0)
                {
                    TraerDatos();
                    CargarDetalle();
                }
                break;

            case "btnCerrar":
                if (SeGuardoObjeto)
                {
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    RecibocajaMnt = null;
                    DialogResult  = DialogResult.OK;
                }
                break;

            case "btnCtacteCliente":
                if (!ValidarDatosImportacion())
                {
                    return;
                }


                List <VwRecibocajaegresodet> vwRecibocajadetMntList = new List <VwRecibocajaegresodet>();

                RecibocajaImpCtacteProveedorFrm recibocajaImpCtacteProveedorFrm = new RecibocajaImpCtacteProveedorFrm(vwRecibocajadetMntList, VwSocionegocioSel, (int)iIdtipomoneda.EditValue);
                recibocajaImpCtacteProveedorFrm.ShowDialog();

                if (recibocajaImpCtacteProveedorFrm.DialogResult == DialogResult.OK)
                {
                    VwRecibocajaegreso vwRecibocajaSelImp = recibocajaImpCtacteProveedorFrm.VwRecibocajaSel;
                    if (vwRecibocajaSelImp != null)
                    {
                        iIdsocionegocio.EditValue = vwRecibocajaSelImp.Idsocionegocio;
                        iIdtipomoneda.EditValue   = vwRecibocajaSelImp.Idtipomoneda;
                    }

                    foreach (var item in vwRecibocajadetMntList)
                    {
                        Recibocajaegresodet recibocajadet = new Recibocajaegresodet();
                        recibocajadet.Idrecibocajaegreso    = IdEntidadMnt;
                        recibocajadet.Idrecibocajaegresodet = item.Idrecibocajaegresodet;
                        recibocajadet.Numeroitem            = item.Numeroitem;
                        recibocajadet.Importepago           = item.Importepago;
                        recibocajadet.Idmediopago           = item.Idmediopago;
                        recibocajadet.Numeromediopago       = item.Numeromediopago;
                        recibocajadet.Comentario            = item.Comentario;
                        recibocajadet.Idcpcompra            = item.Idcpcompra;
                        Service.SaveRecibocajaegresodet(recibocajadet);
                    }


                    CargarDetalle();
                    CargarDetalleImprevistos();
                    SumarTotales(true);
                }
                break;

            case "btnImprimir":
                if (ImpresionFormato == null)
                {
                    ImpresionFormato = new ImpresionFormato();
                }
                if (IdEntidadMnt > 0)
                {
                    ImpresionFormato.FormatoReciboEgreso(RecibocajaMnt);
                }
                break;
            }
        }
Exemplo n.º 4
0
 public int SaveRecibocajaegresodet(Recibocajaegresodet entity)
 {
     return(RecibocajaegresodetDao.Save(entity));
 }