Exemplo n.º 1
0
 /// <summary>
 /// Get
 /// Calls [usp_select_Currency]
 /// </summary>
 public static Currency Get(System.Int32?currencyId)
 {
     Rebound.GlobalTrader.DAL.CurrencyDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.Currency.Get(currencyId);
     if (objDetails == null)
     {
         return(null);
     }
     else
     {
         Currency obj = new Currency();
         obj.CurrencyId          = objDetails.CurrencyId;
         obj.CurrencyCode        = objDetails.CurrencyCode;
         obj.CurrencyDescription = objDetails.CurrencyDescription;
         obj.Symbol    = objDetails.Symbol;
         obj.ClientNo  = objDetails.ClientNo;
         obj.Buy       = objDetails.Buy;
         obj.Sell      = objDetails.Sell;
         obj.Inactive  = objDetails.Inactive;
         obj.UpdatedBy = objDetails.UpdatedBy;
         obj.DLUP      = objDetails.DLUP;
         //[001] code start
         obj.Notes = objDetails.Notes;
         //[001] code end
         obj.GlobalCurrencyNo = objDetails.GlobalCurrencyNo;
         objDetails           = null;
         return(obj);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// GetConvertedValueBetweenTwoCurrencies
 /// Calls [usp_select_Currency_ConvertedValueBetweenTwoCurrencies]
 /// </summary>
 public static Currency GetConvertedValueBetweenTwoCurrencies(System.Double?valueToBeConverted, System.Int32?currencyFromId, System.Int32?currencyToId, System.DateTime?exchangeRateDate)
 {
     Rebound.GlobalTrader.DAL.CurrencyDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.Currency.GetConvertedValueBetweenTwoCurrencies(valueToBeConverted, currencyFromId, currencyToId, exchangeRateDate);
     if (objDetails == null)
     {
         return(null);
     }
     else
     {
         Currency obj = new Currency();
         obj.ConvertedValue = objDetails.ConvertedValue;
         objDetails         = null;
         return(obj);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Returns a new CurrencyDetails instance filled with the DataReader's current record data
        /// </summary>
        protected virtual CurrencyDetails GetCurrencyFromReader(DbDataReader reader)
        {
            CurrencyDetails currency = new CurrencyDetails();

            if (reader.HasRows)
            {
                currency.CurrencyId          = GetReaderValue_Int32(reader, "CurrencyId", 0);                        //From: [Table]
                currency.GlobalCurrencyNo    = GetReaderValue_Int32(reader, "GlobalCurrencyNo", 0);                  //From: [Table]
                currency.CurrencyCode        = GetReaderValue_String(reader, "CurrencyCode", "");                    //From: [usp_list_Activity_by_Client_with_filter]
                currency.CurrencyDescription = GetReaderValue_String(reader, "CurrencyDescription", "");             //From: [usp_select_Client]
                currency.Symbol                    = GetReaderValue_String(reader, "Symbol", "");                    //From: [Table]
                currency.ClientNo                  = GetReaderValue_Int32(reader, "ClientNo", 0);                    //From: [Table]
                currency.Buy                       = GetReaderValue_Boolean(reader, "Buy", false);                   //From: [Table]
                currency.Sell                      = GetReaderValue_Boolean(reader, "Sell", false);                  //From: [Table]
                currency.Inactive                  = GetReaderValue_Boolean(reader, "Inactive", false);              //From: [Table]
                currency.UpdatedBy                 = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);        //From: [Table]
                currency.DLUP                      = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);     //From: [Table]
                currency.ConvertedValue            = GetReaderValue_NullableDouble(reader, "ConvertedValue", null);  //From: [usp_select_Currency_ConvertedValueBetweenTwoCurrencies]
                currency.ClientDefaultCurrencyCode = GetReaderValue_String(reader, "ClientDefaultCurrencyCode", ""); //From: [usp_selectAll_Currency_for_Client]
                currency.ClientDefaultCurrencyNo   = GetReaderValue_Int32(reader, "ClientDefaultCurrencyNo", 0);     //From: [usp_selectAll_Currency_for_Client]
            }
            return(currency);
        }