예제 #1
0
        public void Delete(int Id)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioNOTA_COBRO_DETALLE repositorio         = new RepositorioNOTA_COBRO_DETALLE(context);
                    NOTA_COBRO_DETALLE            _NOTA_COBRO_DETALLE = repositorio.GetById(Id);

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

                    _NOTA_COBRO_DETALLE.ACTIVO = false;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
예제 #2
0
        public void Update(int Id, int NOTA_COBROId, int FACTURAId, int MONTO_PENDIENTE)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioNOTA_COBRO_DETALLE repositorio         = new RepositorioNOTA_COBRO_DETALLE(context);
                    NOTA_COBRO_DETALLE            _NOTA_COBRO_DETALLE = repositorio.GetById(Id);
                    if (Equals(_NOTA_COBRO_DETALLE, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado NOTA_COBRO_DETALLE con Id =", Id.ToString()));
                    }

                    RepositorioNOTA_COBRO _repositorioNOTA_COBRO = new RepositorioNOTA_COBRO(context);
                    NOTA_COBRO            _objNOTA_COBRO         = _repositorioNOTA_COBRO.GetById(NOTA_COBROId);
                    if (Equals(_objNOTA_COBRO, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado NOTA_COBRO con Id =", NOTA_COBROId.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()));
                    }

                    //properties

                    _NOTA_COBRO_DETALLE.MONTO_PENDIENTE = MONTO_PENDIENTE;

                    //parents

                    _NOTA_COBRO_DETALLE.NOTA_COBRO = _objNOTA_COBRO;
                    _NOTA_COBRO_DETALLE.FACTURA    = _objFACTURA;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
예제 #3
0
 public void AddToNOTA_COBRO_DETALLE(NOTA_COBRO_DETALLE nOTA_COBRO_DETALLE)
 {
     base.AddObject("NOTA_COBRO_DETALLE", nOTA_COBRO_DETALLE);
 }
예제 #4
0
 public static NOTA_COBRO_DETALLE CreateNOTA_COBRO_DETALLE(int id, int mONTO_PENDIENTE, bool aCTIVO)
 {
     NOTA_COBRO_DETALLE nOTA_COBRO_DETALLE = new NOTA_COBRO_DETALLE();
     nOTA_COBRO_DETALLE.ID = id;
     nOTA_COBRO_DETALLE.MONTO_PENDIENTE = mONTO_PENDIENTE;
     nOTA_COBRO_DETALLE.ACTIVO = aCTIVO;
     return nOTA_COBRO_DETALLE;
 }