public static bool Update(IDalSession session, IMoneyTransferOrder obj)
 {
     bool blnSuccess = session.InsertOrUpdate(obj);
     if (blnSuccess && obj.Reference == null)
     {
         obj.setReference();
         blnSuccess = session.InsertOrUpdate(obj);
     }
     return blnSuccess;
 }
        public static bool CreateExternalSideSettlement(IDalSession session, IList<ITradingJournalEntry> tradeStatements, IList<IJournalEntryLine> bankStatements)
        {
            if (((tradeStatements != null) && (tradeStatements.Count > 0)) && ((bankStatements != null) && (bankStatements.Count > 0)))
            {
                DateTime settlementDate = (bankStatements[0].BookDate > tradeStatements[0].TransactionDate) ? bankStatements[0].BookDate : tradeStatements[0].TransactionDate;
                ICurrency currency = (ICurrency)bankStatements[0].Balance.Underlying;
                ITradeableInstrument instrument = (ITradeableInstrument)tradeStatements[0].TradeSize.Underlying;
                IGLAccount settleDiffGLAccount = GLAccountMapper.GetSettlementDifferenceGLAccount(session, currency, instrument);
                IJournal journal = JournalMapper.GetSettlementDifferenceJournal(session);
                string nextJournalEntryNumber = JournalEntryMapper.GetNextJournalEntryNumber(session, journal);

                IExternalSettlement settlement = new ExternalSettlement(bankStatements, tradeStatements, settlementDate);
                if (settlement.Settle(journal, nextJournalEntryNumber, settleDiffGLAccount))
                    session.InsertOrUpdate(settlement);
            }
            return true;
        }
 public static bool Update(IDalSession session, IGeneralOperationsBooking obj)
 {
     return session.InsertOrUpdate(obj);
 }
Exemple #4
0
 public static bool Update(IDalSession session, IList list)
 {
     return session.InsertOrUpdate(list);
 }
Exemple #5
0
 /// <summary>
 /// Creates/Updates a new object in the database
 /// </summary>
 /// <param name="session">An instance of the Data Access Library <see cref="T:B4F.TotalGiro.DAL.NHSession">NHSession</see> class</param>
 /// <param name="obj">Object of type ExtPosition</param>
 public static void InsertOrUpdate(IDalSession session, ExtPosition obj)
 {
     session.InsertOrUpdate(obj);
 }
Exemple #6
0
 /// <summary>
 /// Updates a <b>FeeRule</b> object to the database.
 /// </summary>
 /// <param name="session">An instance of the Data Access Library (see class <see cref="B4F.TotalGiro.DAL.NHSession">NHSession</see>).</param>
 /// <param name="obj">The <b>FeeRule</b> object to update into the database.</param>
 public static bool Update(IDalSession session, IFeeRule obj)
 {
     InternalEmployeeLogin emp = LoginMapper.GetCurrentLogin(session) as InternalEmployeeLogin;
     obj.AssetManager = (IAssetManager)emp.Employer;
     return session.InsertOrUpdate(obj);
 }
Exemple #7
0
 public static bool Update(IDalSession session, INota obj)
 {
     return session.InsertOrUpdate(obj);
 }
Exemple #8
0
 public static bool Update(IDalSession session, ILifecycle obj)
 {
     return session.InsertOrUpdate(obj);
 }
Exemple #9
0
 /// <summary>
 /// Either creates or edits a JobHistory object in the database
 /// </summary>
 /// <param name="session">An instance of the Data Access Library <see cref="T:B4F.TotalGiro.DAL.NHSession">NHSession</see> class</param>
 /// <param name="obj">Object of type JobHistory</param>
 public static void InsertOrUpdate(IDalSession session, JobHistory obj)
 {
     session.InsertOrUpdate(obj);
 }
Exemple #10
0
 public static void Update(IDalSession session, IWithdrawalRule obj)
 {
     session.InsertOrUpdate(obj);
 }
Exemple #11
0
 public static bool Update(IDalSession session, ILedgerEntry obj)
 {
     return session.InsertOrUpdate(obj);
 }
Exemple #12
0
 public static bool Update(IDalSession session, IModelBase obj)
 {
     return session.InsertOrUpdate(obj);
 }
Exemple #13
0
 public static bool Update(IDalSession session, IDocument obj)
 {
     return session.InsertOrUpdate(obj);
 }
 public static bool Update(IDalSession session, IHistoricalExRate historicalExRate)
 {
     session.InsertOrUpdate(historicalExRate);
     return true;
 }
Exemple #15
0
 public static bool Update(IDalSession session, IGLDSTDFile obj)
 {
     bool blnSuccess = session.InsertOrUpdate(obj);
     return blnSuccess;
 }
 public static bool Update(IDalSession session, IExportedLedgerFile obj)
 {
     return session.InsertOrUpdate(obj);
 }
Exemple #17
0
 /// <summary>
 /// Updates a <b>CommRule</b> object to the database.
 /// </summary>
 /// <param name="session">An instance of the Data Access Library (see class <see cref="B4F.TotalGiro.DAL.NHSession">NHSession</see>).</param>
 /// <param name="obj">The <b>CommRule</b> object to update into the database.</param>
 public static void Update(IDalSession session, ICommRule obj)
 {
     session.InsertOrUpdate(obj);
 }
Exemple #18
0
 public static bool Update(IDalSession session, FileToImport obj)
 {
     return session.InsertOrUpdate(obj);
 }
Exemple #19
0
 /// <summary>
 /// Persist instrument changes in system
 /// </summary>
 /// <param name="session">Data access object</param>
 /// <param name="instrument">Instrument</param>
 /// <returns>Flag</returns>
 public static bool Update(IDalSession session, IInstrument instrument)
 {
     session.InsertOrUpdate(instrument);
     return true;
 }
 public static bool Update(IDalSession session, PredefinedBeneficiary obj)
 {
     bool blnSuccess = session.InsertOrUpdate(obj);
     return blnSuccess;
 }
        private static void InsertEndTermValue(IDalSession session, IPortfolioHistorical portfolio, IList<IJournalEntryLine> dividends, IPeriodicReporting reportingPeriod)
        {
            IAccountTypeInternal account = portfolio.ParentAccount;
            IEndTermValue etv = new EndTermValue(account, reportingPeriod);

            Money InternalDividend = new Money(0m, account.BaseCurrency);
            Money InternalDividendTax = new Money(0m, account.BaseCurrency);
            Money ExternalDividend = new Money(0m, account.BaseCurrency);
            Money ExternalDividendTax = new Money(0m, account.BaseCurrency);

            if (dividends != null)
            {
                List<IJournalEntryLine> divs = dividends.ToList();
                if (divs.Exists(d => d.GiroAccount.Key == account.Key))
                {
                    if (divs.Exists(d => d.GLAccount.IsGrossDividendInternal))
                        InternalDividend = divs.Where(d => (d.GLAccount.IsGrossDividendInternal && (d.GiroAccount.Key == account.Key))).Select(m => m.Balance.BaseAmount).Sum();
                    if (divs.Exists(d => d.GLAccount.IsDividendTaxInternal))
                        InternalDividendTax = divs.Where(d => (d.GLAccount.IsDividendTaxInternal && (d.GiroAccount.Key == account.Key))).Select(m => m.Balance.BaseAmount).Sum();
                    if (divs.Exists(d => d.GLAccount.IsGrossDividendExternal))
                        ExternalDividend = divs.Where(d => (d.GLAccount.IsGrossDividendExternal && (d.GiroAccount.Key == account.Key))).Select(m => m.Balance.BaseAmount).Sum();
                    if (divs.Exists(d => d.GLAccount.IsDividendTaxExternal))
                        ExternalDividendTax = divs.Where(d => (d.GLAccount.IsDividendTaxExternal && (d.GiroAccount.Key == account.Key))).Select(m => m.Balance.BaseAmount).Sum();
                }
            }

            etv.CashValue = portfolio.CashPortfolio.TotalPortfolioValue;
            etv.FundValue = portfolio.FundPortfolio.TotalPortfolioValue;
            etv.ClosingValue = etv.FundValue + etv.CashValue;
            etv.CultureFundValue = portfolio.FundPortfolio.CultureFundValue.Abs();
            etv.GreenFundValue = portfolio.FundPortfolio.GreenFundValue.Abs();
            etv.InternalDividend = InternalDividend.Abs();
            etv.InternalDividendTax = InternalDividendTax.Abs();
            etv.ExternalDividend = ExternalDividend.Abs();
            etv.ExternalDividendTax = ExternalDividendTax.Abs();
            session.InsertOrUpdate(etv);
        }
Exemple #22
0
 /// <summary>
 /// Inserts a <b>CommCalc</b> object into the database.
 /// </summary>
 /// <param name="session">An instance of the Data Access Library (see class <see cref="B4F.TotalGiro.DAL.NHSession">NHSession</see>).</param>
 /// <param name="obj">The <b>CommCalc</b> object to insert into the database.</param>
 public static void Insert(IDalSession session, ICommCalc obj)
 {
     InternalEmployeeLogin emp = LoginMapper.GetCurrentLogin(session) as InternalEmployeeLogin;
     obj.AssetManager = (IAssetManager) emp.Employer;
     session.InsertOrUpdate(obj);
 }
 public static bool Insert(IDalSession session, IModelPerformance obj)
 {
     InternalEmployeeLogin emp = LoginMapper.GetCurrentLogin(session) as InternalEmployeeLogin;
     obj.EmployeeID = emp.Key;   //employer id;
     return session.InsertOrUpdate(obj);
 }
Exemple #24
0
 public static void Update(IDalSession session, INavCalculation obj)
 {
     session.InsertOrUpdate(obj); ;
 }