Example #1
0
        private static CashDistribution GetCashDistributionLineItemFromBlue(C1_10tblDistToAmberbrookCash blueCashDist, int underlyingFundID, int fundID, CookieCollection cookies, out string resp)
        {
            CashDistribution cashDistLineItem = new CashDistribution();
            resp = string.Empty;
            List<DeepBlue.Models.Deal.DealListModel> deals = DealImport.GetDeals(cookies, true, fundID).Where(x => x.DealNumber == blueCashDist.AmberbrookDealNo).ToList();
            if (deals.Count != 1) {
                if (deals.Count == 0) {
                    resp = string.Format("Cannot find deal with deal#: {0}, for fund: {1}", blueCashDist.AmberbrookDealNo, fundID);
                }
                else if (deals.Count > 1) {
                    resp = string.Format("Cannot uniquely identify deal with deal#: {0}, for fund: {1}. Expected 1 deal. Deals found: {2}", blueCashDist.AmberbrookDealNo, fundID, deals.Count);
                }
                return null;
            }
            DealListModel deal = deals.FirstOrDefault();
            cashDistLineItem.DealID = deal.DealId;
            cashDistLineItem.UnderlyingFundID = underlyingFundID;
            cashDistLineItem.Amount = (decimal)blueCashDist.Proceeds;
            // WARNING: Is this mapping ok?
            // Actually the UI doesnt ask for this field, so i think we are ok here.
            if (blueCashDist.ReceivedDate.HasValue)
                cashDistLineItem.DistributionDate = blueCashDist.ReceivedDate.Value.Date;

            return cashDistLineItem;
        }
Example #2
0
 /// <summary>
 /// Create a new C1_10tblDistToAmberbrookCash object.
 /// </summary>
 /// <param name="transactionID">Initial value of the TransactionID property.</param>
 /// <param name="amberbrookFundNo">Initial value of the AmberbrookFundNo property.</param>
 /// <param name="amberbrookDealNo">Initial value of the AmberbrookDealNo property.</param>
 /// <param name="fund">Initial value of the Fund property.</param>
 /// <param name="effectiveDate">Initial value of the EffectiveDate property.</param>
 /// <param name="proceeds">Initial value of the Proceeds property.</param>
 /// <param name="sSMA_TimeStamp">Initial value of the SSMA_TimeStamp property.</param>
 public static C1_10tblDistToAmberbrookCash CreateC1_10tblDistToAmberbrookCash(global::System.Int32 transactionID, global::System.String amberbrookFundNo, global::System.Int32 amberbrookDealNo, global::System.String fund, global::System.DateTime effectiveDate, global::System.Double proceeds, global::System.Byte[] sSMA_TimeStamp)
 {
     C1_10tblDistToAmberbrookCash c1_10tblDistToAmberbrookCash = new C1_10tblDistToAmberbrookCash();
     c1_10tblDistToAmberbrookCash.TransactionID = transactionID;
     c1_10tblDistToAmberbrookCash.AmberbrookFundNo = amberbrookFundNo;
     c1_10tblDistToAmberbrookCash.AmberbrookDealNo = amberbrookDealNo;
     c1_10tblDistToAmberbrookCash.Fund = fund;
     c1_10tblDistToAmberbrookCash.EffectiveDate = effectiveDate;
     c1_10tblDistToAmberbrookCash.Proceeds = proceeds;
     c1_10tblDistToAmberbrookCash.SSMA_TimeStamp = sSMA_TimeStamp;
     return c1_10tblDistToAmberbrookCash;
 }
Example #3
0
        private static UnderlyingFundCashDistribution GetCashDistributionFromBlue(C1_10tblDistToAmberbrookCash blueCashDist, decimal amount, BlueEntities context, CookieCollection cookies, out string resp)
        {
            resp = string.Empty;
            UnderlyingFundCashDistribution deepBlueCD = new UnderlyingFundCashDistribution();
            C6_10AmberbrookFundInfo ambFundInfo = context.C6_10AmberbrookFundInfo.Where(x => x.AmberbrookFundNo == blueCashDist.AmberbrookFundNo).FirstOrDefault();
            if (ambFundInfo != null) {
                Fund fund = FundImport.GetFund(ambFundInfo.AmberbrookFundName, cookies);
                if (fund != null) {
                    deepBlueCD.FundID = fund.FundID;
                }
                else {
                    resp = "Unable to find AMB Fund: " + ambFundInfo.AmberbrookFundName;
                    return null;
                }
            }
            else {
                resp = "Unable to find AMB Fund#: " + blueCashDist.AmberbrookFundNo;
                return null;
            }

            List<DeepBlue.Models.Deal.UnderlyingFundListModel> underlyingFunds = GetUnderlyingFunds(cookies);
            DeepBlue.Models.Deal.UnderlyingFundListModel uf = underlyingFunds.Where(x => x.FundName == blueCashDist.Fund).FirstOrDefault();
            if (uf != null) {
                deepBlueCD.UnderlyingFundID = uf.UnderlyingFundId;
            }
            else {
                resp = "Unable to find Underlying fund: " + blueCashDist.Fund;
                Util.WriteMissingUnderlyingFund(blueCashDist.Fund);
                Util.Log(resp);
                return null;
            }

            deepBlueCD.Amount = amount;
            // On the UI, this field is labelled Due Date
            if (blueCashDist.NoticeDate.HasValue)
                deepBlueCD.NoticeDate = blueCashDist.NoticeDate.Value.Date;

            // PRDCD is stored in the 1-30tblpostrecorddatetransactions table(Transaction type = cash distribution). so we assuming all the calls here are non-prdcc
            deepBlueCD.IsPostRecordDateTransaction = false;

            // We dont need to provider the value for Received date, as it is assigned on the server side (to DateTime.Now)
            // deepBlueCD.ReceivedDate = DateTime.Now;
            if (blueCashDist.ReceivedDate.HasValue) {
                deepBlueCD.ReceivedDate = blueCashDist.ReceivedDate.Value.Date;
            }
            else {
                deepBlueCD.ReceivedDate = (DateTime.Now).Date;
            }

            // This should be handled in the reconciliation
            #region reconconciliation
            if (blueCashDist.Received.HasValue) {
                deepBlueCD.IsReconciled = blueCashDist.Received.Value;
            }
            deepBlueCD.PaidON = blueCashDist.ReceivedDate;
            // Paid Date is not required
            // TODO: Find out which of Paid Date/Paid On is used for reconciliation
            // deepBlueCD.PaidDate;
            // deepBlueCD.ReconciliationMethod;
            #endregion

            // WARNING: What should the Cash distribution type should be (Cash Distribution/Deemed Distribution/Netted Distribution)
            // Cash Distribution
            deepBlueCD.CashDistributionTypeID = 1;
            return deepBlueCD;
        }
Example #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the C1_10tblDistToAmberbrookCash EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToC1_10tblDistToAmberbrookCash(C1_10tblDistToAmberbrookCash c1_10tblDistToAmberbrookCash)
 {
     base.AddObject("C1_10tblDistToAmberbrookCash", c1_10tblDistToAmberbrookCash);
 }