/// <summary>
 /// Deprecated Method for adding a new object to the C6_10AmberbrookFundInfo EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToC6_10AmberbrookFundInfo(C6_10AmberbrookFundInfo c6_10AmberbrookFundInfo)
 {
     base.AddObject("C6_10AmberbrookFundInfo", c6_10AmberbrookFundInfo);
 }
Exemple #2
0
 private static string ImportAssetInDeal(CookieCollection cookies, BlueEntities context, C6_15tblAmberbrookDealInfo blueDeal, C6_10AmberbrookFundInfo blueDealAmbFund, DeepBlue.Models.Deal.DealListModel deepBlueDeal, int fundID)
 {
     StringBuilder sb = new StringBuilder();
     List<C5_10tblDealOrigination> blueAssetsInDeal = context.C5_10tblDealOrigination.Where(x => x.AmberbrookFundNo == blueDeal.AmberbrookFundNo).Where(x => x.DealNo == blueDeal.DealNo).ToList();
     DealDetailModel deepBlueDealDetail = GetDeal(cookies, deepBlueDeal.DealId);
     foreach (C5_10tblDealOrigination blueAssetInDeal in blueAssetsInDeal) {
         // This can either be a direct or a UF
         C7_10tblGPPaymentInstructions blueAsset = context.C7_10tblGPPaymentInstructions.Where(x => x.Fund.Equals(blueAssetInDeal.Fund, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
         if (blueAsset != null) {
             // Find the deal with the same DealNumber and DealName, and that belongs to the same Amberbrook fund
             if (blueAsset.FundType.Equals("Direct", StringComparison.OrdinalIgnoreCase)) {
                 List<KeyValuePair<C5_11tblDealOriginationDirects, string>> failedDirects = ImportUnderlyingDirect(cookies, context, blueAssetInDeal, deepBlueDeal.DealId, deepBlueDealDetail, fundID);
                 if (failedDirects.Count > 0) {
                     Util.WriteError("The following " + failedDirects.Count + " securities could not be imported:");
                 }
                 foreach (KeyValuePair<C5_11tblDealOriginationDirects, string> failedDirect in failedDirects) {
                     string errorMsg = "Cannot import direct:" + failedDirect.Key.Direct + " into the deal:" + deepBlueDeal.DealId + ", reason:" + failedDirect.Value;
                     Util.WriteError(errorMsg);
                     sb.Append(" " + errorMsg + " ");
                 }
             }
             else {
                 string resp = string.Empty;
                 int? underlyingFundId = ImportUnderlyingFund(cookies, blueAssetInDeal, deepBlueDeal.DealId, fundID, deepBlueDealDetail, out resp);
                 if (!underlyingFundId.HasValue) {
                     string error = "Failed to import underlying fund:" + blueAssetInDeal.Fund + " into deal:" + deepBlueDeal.DealId + ", error:" + resp;
                     Util.WriteError(error);
                     sb.Append(error);
                 }
                 else {
                     Util.Log("New DealUnderlyingFundID:" + underlyingFundId);
                 }
             }
         }
         else {
             string msg = "Unable to find record in C7_10tblGPPaymentInstructions with Fund:" + blueAssetInDeal.Fund;
             Util.WriteError(msg);
             sb.Append(msg);
         }
     }
     return sb.ToString();
 }
 /// <summary>
 /// Create a new C6_10AmberbrookFundInfo object.
 /// </summary>
 /// <param name="amberbrookFundNo">Initial value of the AmberbrookFundNo property.</param>
 /// <param name="amberbrookFundName">Initial value of the AmberbrookFundName property.</param>
 /// <param name="inceptionDate">Initial value of the InceptionDate property.</param>
 public static C6_10AmberbrookFundInfo CreateC6_10AmberbrookFundInfo(global::System.String amberbrookFundNo, global::System.String amberbrookFundName, global::System.DateTime inceptionDate)
 {
     C6_10AmberbrookFundInfo c6_10AmberbrookFundInfo = new C6_10AmberbrookFundInfo();
     c6_10AmberbrookFundInfo.AmberbrookFundNo = amberbrookFundNo;
     c6_10AmberbrookFundInfo.AmberbrookFundName = amberbrookFundName;
     c6_10AmberbrookFundInfo.InceptionDate = inceptionDate;
     return c6_10AmberbrookFundInfo;
 }