Ejemplo n.º 1
0
        /// <summary>
        /// Actualiza el registro en la base de datos
        /// </summary>
        /// <param name="parent">Lista padre</param>
        /// <remarks>La utiliza la BusinessListBaseEx correspondiente para actualizar elementos<remarks/>
        internal void Update(Budgets parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(Library.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                SessionCode = parent.SessionCode;
                BudgetRecord obj = Session().Get <BudgetRecord>(Oid);
                obj.CopyValues(Base.Record);
                Session().Update(obj);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Ejemplo n.º 2
0
 protected override void DataPortal_Update()
 {
     if (IsDirty)
     {
         try
         {
             BudgetRecord obj = Session().Get <BudgetRecord>(Oid);
             obj.CopyValues(Base.Record);
             Session().Update(obj);
             MarkOld();
         }
         catch (Exception ex)
         {
             iQExceptionHandler.TreatException(ex);
         }
     }
 }
Ejemplo n.º 3
0
        public virtual void CopyValues(BudgetRecord source)
        {
            if (source == null)
            {
                return;
            }

            Oid            = source.Oid;
            _oid_serie     = source.OidSerie;
            _oid_cliente   = source.OidCliente;
            _serial        = source.Serial;
            _codigo        = source.Codigo;
            _fecha         = source.Fecha;
            _subtotal      = source.Subtotal;
            _p_descuento   = source.PDescuento;
            _impuestos     = source.Impuestos;
            _total         = source.Total;
            _nota          = source.Nota;
            _observaciones = source.Observaciones;
            _p_irpf        = source.PIRPF;
            _oid_usuario   = source.OidUsuario;
        }