示例#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;
            }
        }
示例#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;
            }
        }
示例#3
0
 public List<PAGO_DETALLE> GetByFilterWithReferences(int? FACTURA_DETALLEId = null, int? PAGOId = null, int? MONTO = null)
 {
     Init();
     try
     {
          using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioPAGO_DETALLE repositorio = new RepositorioPAGO_DETALLE(context);
             return repositorio.GetByFilterWithReferences(FACTURA_DETALLEId, PAGOId, MONTO).OrderBy(i => i.ID).ToList();
         }
     }
     catch (Exception ex)
     {
          ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }
示例#4
0
 public PAGO_DETALLE GetByIdWithReferences(int ID)
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioPAGO_DETALLE repositorio = new RepositorioPAGO_DETALLE(context);
             return repositorio.GetByIdWithReferences(ID);
         }
     }
     catch (Exception ex)
     {
          ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }
示例#5
0
 public List<PAGO_DETALLE> GetAllWithReferences()
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioPAGO_DETALLE repositorio = new RepositorioPAGO_DETALLE(context);
                                 return repositorio.GetAllWithReferences().OrderBy(i => i.ID).ToList();
                             }
     }
     catch (Exception ex)
        {
          ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }