Example #1
0
        public void Delete(int Id)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioPAGO_DETALLE repositorio   = new RepositorioPAGO_DETALLE(context);
                    PAGO_DETALLE            _PAGO_DETALLE = repositorio.GetById(Id);

                    if (Equals(_PAGO_DETALLE, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado PAGO_DETALLE con Id =", Id.ToString()));
                    }

                    _PAGO_DETALLE.ACTIVO = false;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
Example #2
0
        public void Update(int Id, int FACTURA_DETALLEId, int PAGOId, int MONTO)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioPAGO_DETALLE repositorio   = new RepositorioPAGO_DETALLE(context);
                    PAGO_DETALLE            _PAGO_DETALLE = repositorio.GetById(Id);
                    if (Equals(_PAGO_DETALLE, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado PAGO_DETALLE con Id =", Id.ToString()));
                    }

                    RepositorioFACTURA_DETALLE _repositorioFACTURA_DETALLE = new RepositorioFACTURA_DETALLE(context);
                    FACTURA_DETALLE            _objFACTURA_DETALLE         = _repositorioFACTURA_DETALLE.GetById(FACTURA_DETALLEId);
                    if (Equals(_objFACTURA_DETALLE, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado FACTURA_DETALLE con Id =", FACTURA_DETALLEId.ToString()));
                    }

                    RepositorioPAGO _repositorioPAGO = new RepositorioPAGO(context);
                    PAGO            _objPAGO         = _repositorioPAGO.GetById(PAGOId);
                    if (Equals(_objPAGO, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado PAGO con Id =", PAGOId.ToString()));
                    }

                    //properties

                    _PAGO_DETALLE.MONTO = MONTO;

                    //parents

                    _PAGO_DETALLE.FACTURA_DETALLE = _objFACTURA_DETALLE;
                    _PAGO_DETALLE.PAGO            = _objPAGO;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
 public void AddToPAGO_DETALLE(PAGO_DETALLE pAGO_DETALLE)
 {
     base.AddObject("PAGO_DETALLE", pAGO_DETALLE);
 }
 public static PAGO_DETALLE CreatePAGO_DETALLE(int id, int mONTO, bool aCTIVO)
 {
     PAGO_DETALLE pAGO_DETALLE = new PAGO_DETALLE();
     pAGO_DETALLE.ID = id;
     pAGO_DETALLE.MONTO = mONTO;
     pAGO_DETALLE.ACTIVO = aCTIVO;
     return pAGO_DETALLE;
 }