コード例 #1
0
        public void Delete(int Id)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioFACTURA_DETALLE repositorio      = new RepositorioFACTURA_DETALLE(context);
                    FACTURA_DETALLE            _FACTURA_DETALLE = repositorio.GetById(Id);

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

                    _FACTURA_DETALLE.ACTIVO = false;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
コード例 #2
0
        public void Update(int Id, int FACTURAId, int PRESTACIONId, int MONTO_TOTAL, int MONTO_COBRADO)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioFACTURA_DETALLE repositorio      = new RepositorioFACTURA_DETALLE(context);
                    FACTURA_DETALLE            _FACTURA_DETALLE = repositorio.GetById(Id);
                    if (Equals(_FACTURA_DETALLE, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado FACTURA_DETALLE con Id =", Id.ToString()));
                    }

                    RepositorioFACTURA _repositorioFACTURA = new RepositorioFACTURA(context);
                    FACTURA            _objFACTURA         = _repositorioFACTURA.GetById(FACTURAId);
                    if (Equals(_objFACTURA, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado FACTURA con Id =", FACTURAId.ToString()));
                    }

                    RepositorioPRESTACION _repositorioPRESTACION = new RepositorioPRESTACION(context);
                    PRESTACION            _objPRESTACION         = _repositorioPRESTACION.GetById(PRESTACIONId);
                    if (Equals(_objPRESTACION, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado PRESTACION con Id =", PRESTACIONId.ToString()));
                    }

                    //properties

                    _FACTURA_DETALLE.MONTO_TOTAL   = MONTO_TOTAL;
                    _FACTURA_DETALLE.MONTO_COBRADO = MONTO_COBRADO;

                    //parents

                    _FACTURA_DETALLE.FACTURA    = _objFACTURA;
                    _FACTURA_DETALLE.PRESTACION = _objPRESTACION;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
コード例 #3
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;
            }
        }
コード例 #4
0
 public FACTURA_DETALLE GetByIdWithReferences(int ID)
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioFACTURA_DETALLE repositorio = new RepositorioFACTURA_DETALLE(context);
             return(repositorio.GetByIdWithReferences(ID));
         }
     }
     catch (Exception ex)
     {
         ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }
コード例 #5
0
 public List <FACTURA_DETALLE> GetAllWithReferences()
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioFACTURA_DETALLE repositorio = new RepositorioFACTURA_DETALLE(context);
             return(repositorio.GetAllWithReferences().OrderBy(i => i.ID).ToList());
         }
     }
     catch (Exception ex)
     {
         ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }
コード例 #6
0
 public List <FACTURA_DETALLE> GetByFilterWithReferences(int?FACTURAId = null, int?PRESTACIONId = null, int?MONTO_TOTAL = null, int?MONTO_COBRADO = null)
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioFACTURA_DETALLE repositorio = new RepositorioFACTURA_DETALLE(context);
             return(repositorio.GetByFilterWithReferences(FACTURAId, PRESTACIONId, MONTO_TOTAL, MONTO_COBRADO).OrderBy(i => i.ID).ToList());
         }
     }
     catch (Exception ex)
     {
         ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }