Exemple #1
0
        public object GetPropertyValue(object component, int property)
        {
            MonetaryAmount amount = (MonetaryAmount)component;

            if (property == 0)
            {
                return(amount.Value);
            }
            else
            {
                return(amount.Currency);
            }
        }
Exemple #2
0
 public void NullSafeSet(IDbCommand cmd, object obj, int index)
 {
     if (obj == null)
     {
         ((IDataParameter)cmd.Parameters[index]).Value = DBNull.Value;
     }
     else
     {
         MonetaryAmount anyCurrency = (MonetaryAmount)obj;
         MonetaryAmount amountInUSD =
             MonetaryAmount.Convert(anyCurrency, "USD");
         ((IDataParameter)cmd.Parameters[index]).Value = amountInUSD.Value;
     }
 }
Exemple #3
0
 public void NullSafeSet(IDbCommand cmd, object obj, int index,
                         NHibernate.Engine.ISessionImplementor session)
 {
     if (obj == null)
     {
         ((IDataParameter)cmd.Parameters[index]).Value     = DBNull.Value;
         ((IDataParameter)cmd.Parameters[index + 1]).Value = DBNull.Value;
     }
     else
     {
         MonetaryAmount amount = (MonetaryAmount)obj;
         ((IDataParameter)cmd.Parameters[index]).Value     = amount.Value;
         ((IDataParameter)cmd.Parameters[index + 1]).Value = amount.Currency;
     }
 }