2013-04-27 46 views
1
namespace CQGlobal.BackOffice.Domain.RmsRepository 
{ 
    using System; 
    using CQGlobal.BackOffice.Domain.RmsModel; 
    using CQGlobal.BackOffice.Service.Types; 
    using System.Collections.Generic; 
    using TmsModel = CQGlobal.BackOffice.Domain.TmsModel; 
    using tmsTypes = CQGlobal.BackOffice.Domain.TmsTypes; 

    public interface IRiskManagementRepository : IDisposable 
    { 
     void DataAffectedByPriceChange(List<Tb_ClosingPrice> prices); 

     //void DataAffectedByPositionChangeByOrder(List<Tb_OrderImport> orders); 

     //IEnumerable<string> DataAffectedByPositionChangeByOrder(List<Tb_OrderImport> orders, ref List<RMSSummary> summary); 

     IEnumerable<string> ExecuteNewOrders(List<Tb_OrderImport> orders, bool simulate = false); 

     IEnumerable<string> FetchRMSTopics(string search); 

     IEnumerable<string> FetchRMSTopics(string search, string orderby="AcctNo", int page=0, int size=0); 

     IEnumerable<RMSDisplay> FetchRMSSummary(string search); 

     IEnumerable<RMSDisplay> FetchRMSSummary(string search, string orderby = "AcctNo", int page = 0, int size = 0); 

     IEnumerable<RMSDisplay> FetchRMSSummaryByTopic(List<string> topics, long companyId); 

     IEnumerable<string> InsertRiskManagementSummaryRemarks(Tb_RiskManagementSummaryRemarks remark); 

     IEnumerable<string> UpdateRiskManagementSummaryRemarks(Tb_RiskManagementSummaryRemarks remark); 

     IEnumerable<string> DeleteRiskManagementSummaryRemarks(Tb_RiskManagementSummaryRemarks remark); 

     IEnumerable<string> DeleteRiskManagementSummaryRemarks(Guid recordId); 

     IEnumerable<Tb_RiskManagementSummaryRemarks> FetchSummaryRemarks(string acctNo, long companyId, int period = 0); 

     #region "RMS details" 

     IEnumerable<Tb_CashRPValuationCollateral> FetchValuationCollateral(long companyId, string acctNo = null, string currCd = null, long fundSourceID = 0); 

     IEnumerable<Tb_CustodyAssetsRPValuationCollateral> FetchValuationCollateral(long companyId, string acctNo = null, string currCd = null, long fundSourceID = 0, long instrumentId = 0, long productId = 0); 

     IEnumerable<Tb_NonEquityAssetsValuationCollateral> FetchValuationCollateral(long companyId, string acctNo = null, string assetNo = null); 

     IEnumerable<TmsModel.Tb_Transactions> FetchTMSTransactions(long companyId, string acctNo = null, string transNo = null, string transGroupNo = null, string currCd = null, long fundSourceID = 0); 

     IEnumerable<Tb_ContractOutstanding> FetchOutstandingContracts(long companyId, string acctNo = null, string contractNo = null, short contractPartNo = -1, string currCd = null, long fundSourceID = 0); 

     IEnumerable<TmsModel.Tb_ContractOutstanding> FetchTMSOutstandingContracts(long companyId, string acctNo = null, string contractNo = null, short contractPartNo = -1, string currCd = null, long fundSourceID = 0); 

     IEnumerable<Tb_OrderImport> FetchOrders(long companyId, string acctNo = null, long orderNo = 0, long subOrderNo = -1, string currCd = null); 

     IEnumerable<TmsModel.Tb_ContractOutstanding> FetchExecutedOrdersAndTMSContracts(long companyId, string acctNo = null, string currCd = null); 

     Tb_Date FetchBusinessDate(long companyId = 0); 

     #endregion "RMS details" 

    } 
} 








[LogOperation] 
[LogServiceErrors] 
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.PerCall)] 
public class RmsOrchestrationContext : EntityService<IRiskManagementRepository>, CQGlobal.BackOffice.Service.Types.Contracts.IRmsContract 
    { 
     public string DoWork(string work) 
     { 
      //System.Diagnostics.Trace.WriteLine("Called From Service"); 
      return string.Format("You entered: {0}", work); 
     } 


public IEnumerable<RMSDisplay> SearchSummary(string filter,string ordering="AccountNo",int pageNo=0, int pageSize=0) 
     { 
      try 
      { 
       using (IRiskManagementRepository repo = new RiskManagementRepository()) 
       { 
        return repo.FetchRMSSummary(filter, ordering, pageNo, pageSize); 
       } 
      } 
      catch (Exception ex) 
      { 
       throw ex; 
      } 
      finally 
      { 
      } 

     } 




namespace CQGlobal.BackOffice.Service.Types 
{ 
    using System; 
    using System.Runtime.Serialization; 
    using System.Text; 
    using System.Collections.Generic; 

    [DataContract(IsReference = true, Namespace = "http://www.cqglobal.com/rms/")] 
    [Serializable] 
    public class RMSDisplay 
    { 
     [DataMember] 
     public System.DateTime ReportDate { get; set; } 

     [DataMember] 
     public string RecordType { get; set; } 

     [DataMember] 
     public string AggregateLevel { get; set; } 

     [DataMember] 
     public string AcctNo { get; set; } 

     [DataMember] 
     public long CompanyId { get; set; } 

     [DataMember] 
     public string CurrCd { get; set; } 

     [DataMember] 
     public int SchemeId { get; set; } 

     [DataMember] 
     public decimal ExchRate { get; set; } 

     [DataMember] 
     public decimal LedgerBFBalance { get; set; } 

     [DataMember] 
     public decimal EquitySettlement { get; set; } 

     [DataMember] 
     public decimal Adjustment { get; set; } 

     [DataMember] 
     public decimal RealisedPL { get; set; } 

     [DataMember] 
     public decimal CommissionCharges { get; set; } 

     [DataMember] 
     public decimal OptionPremium { get; set; } 

     [DataMember] 
     public decimal LedgerRPBalance { get; set; } 

     [DataMember] 
     public decimal CollateralRPBalance { get; set; } 

     [DataMember] 
     public decimal UnrealisedPLBalance { get; set; } 

     [DataMember] 
     public decimal MarginIM { get; set; } 

     [DataMember] 
     public decimal MarginMM { get; set; } 

     [DataMember] 
     public decimal MarginIMExcessDeficit { get; set; } 

     [DataMember] 
     public decimal MarginIMRPExcessDeficit { get; set; } 

     [DataMember] 
     public decimal MarginMMExcessDeficit { get; set; } 

     [DataMember] 
     public decimal MarginMMRPExcessDeficit { get; set; } 

     [DataMember] 
     public System.DateTime LastUpdated { get; set; } 

     [DataMember] 
     public string AcctExecutiveCd { get; set; } 

     [DataMember] 
     public Nullable<System.Guid> RecordId { get; set; } 

     [DataMember] 
     public string Topic { get; set; } 

     [DataMember] 
     public string Remarks { get; set; } 

     [DataMember] 
     public int Page { get; set; } 

     [DataMember] 
     public int Size { get; set; } 

     [DataMember] 
     public int TotalCount { get; set; } 

     [DataMember] 
     public List<string> ValidationErrors { get; set; } 

     *[DataMember] 
     public string ClientName { get; set; }* 



     #region IExtensibleDataObject Members 

     public ExtensionDataObject ExtensionData { get; set; } 

     #endregion IExtensibleDataObject Members 
    } 
} 

我在visual studio 2010版本中編寫了我的服務。然後我將它升級到Visual Studio 2012.當我將屬性添加到我的合同中時,ClientName對此屬性獲得了空值。我已經嘗試在字段中輸入順序,但我仍然沒有得到我所期望的值,即使我對該值進行了硬編碼。我也嘗試回收AppPool,重啓我的電腦仍然有錯誤。對不起,我沒有告訴你這個函數的實際實現repo.FetchRMSSummary(過濾器,排序,pageNo,pageSize)。當我在服務器端追蹤它時,它有一個值,但是當我使用服務時,我無法獲得正確的值。我的房產成爲空對象,但其餘的舊房產具有正確的價值。wcf合同添加屬性在現有合同上得到空值

請幫幫我。

+1

您是否更新客戶端的參考? – Tim 2013-04-27 05:48:40

+0

是的,我更新了我的客戶。我刪除了引用和附加參考再次與更新的dll – Kline 2013-04-27 09:06:08

回答

0

我會嘗試重寫您的對象的反序列化來調試它。反序列化失敗時,我遇到了類似的問題。

+0

實際上這個項目是由誰已經離開,現在我是他的代碼的繼任者開發的。他有一個項目,如[程序集:System.Reflection.AssemblyVersionAttribute(「1.0.0.0」)] [assembly:System.Xml.Serialization.XmlSerializerVersionAttribute(ParentAssemblyId = @「128e48f7-e37b-4470-8a30-9c970ac05f15」,Version = @「4.0.0.0」)] namespace Microsoft.Xml.Serialization.GeneratedAssembly { public class XmlSerializationWriter1:System.Xml.Serialization.XmlSerializationWriter { ......在這個項目中,我摘要的是它自動收攏合同。 – Kline 2013-04-30 06:48:45

0

我已經解決了這個問題。實際上,我們制定了合同的序列化程序,以便它可以提高服務的性能,並且由於它緩存到系統中,我的客戶得到了一個古怪的行爲,這有些不好。