当前位置: 首页>>代码示例>>C#>>正文


C# IDalSession.Update方法代码示例

本文整理汇总了C#中IDalSession.Update方法的典型用法代码示例。如果您正苦于以下问题:C# IDalSession.Update方法的具体用法?C# IDalSession.Update怎么用?C# IDalSession.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDalSession的用法示例。


在下文中一共展示了IDalSession.Update方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: runCalculateFeesForUnit

 private bool runCalculateFeesForUnit(IDalSession session, FeeFactory feeFactory, IManagementPeriodUnit unit, out string message)
 {
     bool success = false;
     message = "";
     try
     {
         switch (unit.ManagementPeriod.ManagementType)
         {
             case B4F.TotalGiro.Accounts.ManagementPeriods.ManagementTypes.ManagementFee:
                 unit.Success = feeFactory.CalculateFeePerUnit(session, unit);
                 break;
             case B4F.TotalGiro.Accounts.ManagementPeriods.ManagementTypes.KickBack:
                 unit.Success = calculateKickBackOnUnit(session, unit, out message);
                 break;
         }
         if (!string.IsNullOrEmpty(message))
             unit.Message = message;
         success = session.Update(unit);
     }
     catch (Exception ex)
     {
         message = Util.GetMessageFromException(ex);
         string logMessage = string.Format("Error in runCalculateFeesForUnit -> unit: {0}; {1}", unit.Key, message);
         log.Error(logMessage);
     }
     return success;
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:27,代码来源:ValuationEngine.cs

示例2: Update

 public static bool Update(IDalSession session, DividWepFile obj)
 {
     return session.Update(obj);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:4,代码来源:DividWepFileMapper.cs

示例3: Update

 public static void Update(IDalSession session, IList list)
 {
     session.Update(list);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:4,代码来源:CountryMapper.cs

示例4: setAccountValidityDate

 private void setAccountValidityDate(IDalSession session, IAccountTypeCustomer account, DateTime maxValuationDate)
 {
     account.ValuationMutationValidityDate = maxValuationDate;
     session.Update(account);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:5,代码来源:ValuationEngine.cs

示例5: Update

 public static void Update(IDalSession session, IAccountHolder obj)
 {
     session.Update(obj);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:4,代码来源:AccountHolderMapper.cs

示例6: updateSingleQuoteHistory


//.........这里部分代码省略.........
                                                reader.MoveToAttribute("value");
                                                lastquote = reader.Value;
                                            }
                                            if (reader.NodeType == XmlNodeType.Element && reader.Name == "Previous")
                                            {
                                                reader.MoveToAttribute("value");
                                                previousquote = reader.Value;
                                                reader.MoveToAttribute("date");
                                                previousdate = reader.Value;
                                            }
                                            if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "Quote")
                                            {
                                                // Only allow insert/update of a price when it exchange has closed
                                                if (closedquote.Length > 0)
                                                {

                                                    CultureInfo culture = new CultureInfo(CultureInfo.CurrentCulture.Name);

                                                    NumberFormatInfo numInfo = (NumberFormatInfo)culture.GetFormat(typeof(NumberFormatInfo));
                                                    numInfo.NumberDecimalSeparator = ".";

                                                    DateTime dtQuoteDate = DateTime.Parse(quotedate);

                                                    ICurrency newcur = (ICurrency)InstrumentMapper.GetCurrencyByName(session, quotecurrency);

                                                    // For TBM Data the price is the closed price
                                                    decimal dClosedQuote = decimal.Parse(closedquote, numInfo);
                                                    Price newclosedprice = new Price(new Money(dClosedQuote, newcur), instrument);
                                                    IHistoricalPrice newhprice = new HistoricalPrice(newclosedprice, dtQuoteDate);
                                                    newhprice.ClosedPrice = newclosedprice;

                                                    Price newopenprice = null;
                                                    Price newhighprice = null;
                                                    Price newlowprice = null;

                                                    if (openquote.Length > 0)
                                                    {
                                                        decimal dOpenQuote = decimal.Parse(openquote, numInfo);
                                                        newopenprice = new Price(new Money(dOpenQuote, newcur), instrument);
                                                        newhprice.OpenPrice = newopenprice;
                                                    }
                                                    if (highquote.Length > 0)
                                                    {
                                                        decimal dHighQuote = decimal.Parse(highquote, numInfo);
                                                        newhighprice = new Price(new Money(dHighQuote, newcur), instrument);
                                                        newhprice.HighPrice = newhighprice;
                                                    }
                                                    if (lowquote.Length > 0)
                                                    {
                                                        decimal dLowQuote = decimal.Parse(lowquote, numInfo);
                                                        newlowprice = new Price(new Money(dLowQuote, newcur), instrument);
                                                        newhprice.LowPrice = newlowprice;
                                                    }
                                                    if (instrument.HistoricalPrices.ContainsHistoricalPrice(newhprice))
                                                    {
                                                        // Look for previous price to see if it differs too much

                                                        instrument.HistoricalPrices.AddHistoricalPrice(newhprice);

                                                        if (instrument.HistoricalPrices.Count > 1)
                                                        {
                                                            IHistoricalPrice prevhprice = (IHistoricalPrice)instrument.HistoricalPrices.GetItemByDate(dtQuoteDate.AddDays(-1));
                                                            decimal diff = Math.Abs((prevhprice.Price.Quantity - newhprice.Price.Quantity) / prevhprice.Price.Quantity) * 100;
                                                            if (diff > 10)
                                                                // More than 10% difference, raise warning
                                                                throw new ApplicationException(String.Format("Price of instrument: {0} differs more than 10%. Old price: {1}, New price {2}, difference {3}", instrument.Isin, prevhprice.Price, newhprice.Price, diff));
                                                        }

                                                    }
                                                    else
                                                    {
                                                        IHistoricalPrice existinghprice = (IHistoricalPrice)instrument.HistoricalPrices.GetItemByDate(dtQuoteDate);
                                                        existinghprice.Price = newclosedprice;
                                                        existinghprice.ClosedPrice = newclosedprice;
                                                        existinghprice.OpenPrice = newopenprice;
                                                        existinghprice.HighPrice = newhighprice;
                                                        existinghprice.LowPrice = newlowprice;
                                                    }
                                                    session.Update(instrument);
                                                }
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                            if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "Organisation")
                                break;
                        }
                    }
                }
            }
            finally
            {
                // Unknown ISIN or error retrieving one
                if (reader != null)
                    reader.Close();
            }
            return;
        }
开发者ID:kiquenet,项目名称:B4F,代码行数:101,代码来源:TBMRequest.cs

示例7: Update

 /// <summary>
 /// Updates a ManagementCompany
 /// </summary>
 /// <param name="session">An instance of the Data Access Library <see cref="T:B4F.TotalGiro.DAL.NHSession">NHSession</see> class</param>
 /// <param name="list">The ManagementCompany</param>
 public static void Update(IDalSession session, IManagementCompany obj)
 {
     session.Update(obj);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:9,代码来源:ManagementCompanyMapper.cs

示例8: Update

 /// <summary>
 /// Updates a ReportTemplate
 /// </summary>
 /// <param name="session">An instance of the Data Access Library <see cref="T:B4F.TotalGiro.DAL.NHSession">NHSession</see> class</param>
 /// <param name="list">The ReportTemplate</param>
 public static void Update(IDalSession session, IReportTemplate obj)
 {
     session.Update(obj);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:9,代码来源:ReportTemplateMapper.cs

示例9: Update

 /// <summary>
 /// Updates an object, saves its data to 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 Login</param>
 public static void Update(IDalSession session, ILogin obj)
 {
     session.Update(obj);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:9,代码来源:LoginMapper.cs

示例10: Update

 public static void Update(IDalSession session, ICounterAccount obj)
 {
     session.Update(obj);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:4,代码来源:CounterAccountMapper.cs

示例11: Update

 public static bool Update(IDalSession session, IRemisier obj)
 {
     return session.Update(obj);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:4,代码来源:RemisierMapper.cs

示例12: Update

 /// <summary>
 /// Saves the data of an existing list of FSExportFile objects.
 /// </summary>
 /// <param name="DataSession">data session object</param>
 /// <param name="obj">list of existing FSExportFile objects</param>
 public static void Update(IDalSession DataSession, IList list)
 {
     DataSession.Update(list);
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:9,代码来源:FSExportFileMapper.cs


注:本文中的IDalSession.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。