private void PopulateEQDataObject(List <ve_g1position_gqlObject> raw, AsyncObservableCollection <EquilendExcelDataObjectGrid> EQData, string LegalEntity) { foreach (var ri in raw) { try { EquilendExcelDataObjectGrid EQ = new EquilendExcelDataObjectGrid(); //Just for grid EQ.Cpty = ri.CPTY; EQ.Name = ri.NAME; EQ.CtpyAgentAccount = ri.CtpyAgentAccount; EQ.TIMETABLE_ID = ri.TimeTableID.ToString(); EQ.EQUILEND_TXN_ID = ""; //Required EQ.LEGAL_ENTITY_ID = LegalEntity; EQ.CPTY_LEGAL_ENTITY_ID = ri.LoanNet_Counterparty_Id; //Stored proc changes this to equilend id EQ.BORROW_LOAN_TYPE_CD = ri.BL; EQ.SUBACCOUNT_ID = ""; //Required EQ.SECURITY_ID = string.IsNullOrEmpty(ri.CUSIP) ? ri.SEDOL : ri.CUSIP; EQ.SECURITY_ID_TYPE_CD = string.IsNullOrEmpty(ri.CUSIP) ? "S" : "C"; //I,S,C,Q,V EQ.RATE_TYPE_CD = ""; EQ.RATE_AMT = (ri.CASH != null && ri.CASH.ToLower() == "c") ? ri.LNRATE.Value.ToString() : EQ.RATE_AMT; EQ.FEE_TYPE_CD = ""; //EQ.FEE_AMT = (ri.CASH != null && ri.CASH.ToLower() == "n" && ri.COLL_FLG != null && ri.COLL_FLG.ToLower() == "t") ? ri.LNRATE.Value.ToString() : EQ.FEE_AMT; if (ri.CASH != null && ri.CASH.ToLower() == "n") { EQ.FEE_AMT = ri.LNRATE.Value.ToString(); } else { EQ.FEE_AMT = EQ.FEE_AMT; } //if cash n and coll flg c then EQ.DIVIDEND_RATE_PCT = ri.DIV_AGE.ToString(); EQ.DIVIDEND_TRACKING_IND = ri.LNT_DIV_TRACKING; switch (ri.CASH.ToUpper()) { case "C": EQ.COLLATERAL_TYPE_CD = "CA"; break; case "N": EQ.COLLATERAL_TYPE_CD = "NC"; break; case "T": EQ.COLLATERAL_TYPE_CD = "CP"; break; default: EQ.COLLATERAL_TYPE_CD = "CA"; break; } EQ.BILLING_FX_RATE = ""; EQ.BILLING_DERIVATION_IND = ""; EQ.COLLATERAL_CURRENCY_CD = ri.LNCUR; EQ.CALLABLE_IND = ri.CALL; //if callabledate is set, this must be set to y EQ.SETTLEMENT_DT = ri.SSET_DT.HasValue ? ri.SSET_DT.Value.ToString("yyyyMMdd") : ""; //Required //CT=Contract, RT=Return, RC=Recall, CL=Collateral switch (ri.COLL_FLG.ToUpper()) { case "T": EQ.COMPARE_RECORD_TYPE_CD = "CT"; break; case "C": EQ.COMPARE_RECORD_TYPE_CD = "CL"; break; default: EQ.COMPARE_RECORD_TYPE_CD = EQ.COMPARE_RECORD_TYPE_CD; break; } EQ.UNIT_QTY = ri.QTY.ToString(); //Required switch (ri.OP.ToUpper()) { case "O": EQ.ORDER_STATE_CD = "OP"; break; case "P": EQ.ORDER_STATE_CD = "PS"; break; default: EQ.ORDER_STATE_CD = "OP"; break; } EQ.ORDER_STATE_CD = ri.OP == "O" ? "OP" : "PS"; EQ.PREPAY_RATE_PCT = ri.CRATE.HasValue ? ri.CRATE.ToString() : ""; EQ.CASH_PAYMENT_AMT = ri.LNVAL.ToString(); EQ.BILLING_VALUE_AMT = ri.LNVAL.ToString(); EQ.BILLING_CURRENCY_CD = ""; EQ.COLLATERAL_DESC_CD = ""; if (ri.QTY > 0) { EQ.CONTRACT_PRICE_AMT = Math.Round(ri.LNVAL.Value / ri.QTY.Value, 6).ToString(); //EQ.CONTRACT_PRICE_AMT = (ri.LNVAL / ri.QTY).ToString(); } else { EQ.CONTRACT_PRICE_AMT = 0.ToString(); } EQ.COLLATERAL_MARGIN_PCT = ri.LNMRG.ToString(); EQ.CONTRACT_VALUE_AMT = ri.LNVAL.ToString(); EQ.TRADE_DT = ri.TRADE.HasValue ? ri.TRADE.Value.ToString("yyyyMMdd") : ""; EQ.COLLATERAL_DT = ""; EQ.TERM_DT = ri.TERMDT.HasValue ? ri.TERMDT.Value.ToString("yyyyMMdd") : EQ.TERM_DT; EQ.TERM_TYPE_CD = ""; EQ.HOLD_DT = ""; EQ.CALLABLE_DT = ""; EQ.RESET_INTERVAL_DAYS = ""; EQ.REBATE_RECEIVABLE_AMT = ""; EQ.REBATE_PAYABLE_AMT = ""; EQ.FEE_RECEIVABLE_AMT = ""; EQ.FEE_PAYABLE_AMT = ""; EQ.RATE_ADJUST_DT = ""; EQ.BUYIN_DT = ""; EQ.TERMINATION_IND = ""; EQ.BORROWER_SETTLE_INSTRUC_ID = ""; EQ.LENDER_SETTLE_INSTRUC_ID = ""; EQ.SETTLEMENT_TYPE_CD = ""; EQ.MARKING_PARAMETERS = ""; //Required EQ.INTERNAL_REF_ID = ri.BGNREF; EQ.COUNTERPARTY_REF_ID = ""; EQ.CORPORATE_ACTION_TYPE = ""; //Corp Actions EQ.EX_DT = ""; //Corp Actions EQ.RECORD_DT = ""; //Corp Actions EQ.INTERNAL_CUSTOM_FIELD = ""; EQ.EXTERNAL_CUSTOM_FIELD = ""; EQ.OLD_EQUILEND_TXN_ID = ""; EQ.BILLING_PRICE_AMT = ""; EQ.BILLING_MARGIN_PCT = ""; EQ.COLLATERAL_VALUE_AMT = ri.LNVAL.ToString(); EQ.EQUILEND_RETURN_ID = ""; EQ.RETURN_TRADE_DT = ""; EQ.RETURN_SETTLEMENT_DT = ""; EQ.EQUILEND_RECALL_ID = ""; EQ.RECALL_EFFECTIVE_DT = ""; EQ.RECALL_DUE_DT = ""; EQ.REASON_CD = ""; EQData.Add(EQ); } catch (Exception e) { throw; } } }
private void PopulateEQDataObject(List<ve_g1position_gqlObject> raw, AsyncObservableCollection<EquilendExcelDataObjectGrid> EQData, string LegalEntity) { foreach (var ri in raw) { try { EquilendExcelDataObjectGrid EQ = new EquilendExcelDataObjectGrid(); //Just for grid EQ.Cpty = ri.CPTY; EQ.Name = ri.NAME; EQ.CtpyAgentAccount = ri.CtpyAgentAccount; EQ.TIMETABLE_ID = ri.TimeTableID.ToString(); EQ.EQUILEND_TXN_ID = ""; //Required EQ.LEGAL_ENTITY_ID = LegalEntity; EQ.CPTY_LEGAL_ENTITY_ID = ri.LoanNet_Counterparty_Id; //Stored proc changes this to equilend id EQ.BORROW_LOAN_TYPE_CD = ri.BL; EQ.SUBACCOUNT_ID = ""; //Required EQ.SECURITY_ID = string.IsNullOrEmpty(ri.CUSIP) ? ri.SEDOL : ri.CUSIP; EQ.SECURITY_ID_TYPE_CD = string.IsNullOrEmpty(ri.CUSIP) ? "S" : "C"; //I,S,C,Q,V EQ.RATE_TYPE_CD = ""; EQ.RATE_AMT = (ri.CASH != null && ri.CASH.ToLower() == "c") ? ri.LNRATE.Value.ToString() : EQ.RATE_AMT; EQ.FEE_TYPE_CD = ""; //EQ.FEE_AMT = (ri.CASH != null && ri.CASH.ToLower() == "n" && ri.COLL_FLG != null && ri.COLL_FLG.ToLower() == "t") ? ri.LNRATE.Value.ToString() : EQ.FEE_AMT; if (ri.CASH != null && ri.CASH.ToLower() == "n") { EQ.FEE_AMT = ri.LNRATE.Value.ToString(); } else { EQ.FEE_AMT = EQ.FEE_AMT; } //if cash n and coll flg c then EQ.DIVIDEND_RATE_PCT = ri.DIV_AGE.ToString(); EQ.DIVIDEND_TRACKING_IND = ri.LNT_DIV_TRACKING; switch (ri.CASH.ToUpper()) { case "C": EQ.COLLATERAL_TYPE_CD = "CA"; break; case "N": EQ.COLLATERAL_TYPE_CD = "NC"; break; case "T": EQ.COLLATERAL_TYPE_CD = "CP"; break; default: EQ.COLLATERAL_TYPE_CD = "CA"; break; } EQ.BILLING_FX_RATE = ""; EQ.BILLING_DERIVATION_IND = ""; EQ.COLLATERAL_CURRENCY_CD = ri.LNCUR; EQ.CALLABLE_IND = ri.CALL; //if callabledate is set, this must be set to y EQ.SETTLEMENT_DT = ri.SSET_DT.HasValue ? ri.SSET_DT.Value.ToString("yyyyMMdd") : ""; //Required //CT=Contract, RT=Return, RC=Recall, CL=Collateral switch (ri.COLL_FLG.ToUpper()) { case "T": EQ.COMPARE_RECORD_TYPE_CD = "CT"; break; case "C": EQ.COMPARE_RECORD_TYPE_CD = "CL"; break; default: EQ.COMPARE_RECORD_TYPE_CD = EQ.COMPARE_RECORD_TYPE_CD; break; } EQ.UNIT_QTY = ri.QTY.ToString(); //Required switch (ri.OP.ToUpper()) { case "O": EQ.ORDER_STATE_CD = "OP"; break; case "P": EQ.ORDER_STATE_CD = "PS"; break; default: EQ.ORDER_STATE_CD = "OP"; break; } EQ.ORDER_STATE_CD = ri.OP == "O" ? "OP" : "PS"; EQ.PREPAY_RATE_PCT = ri.CRATE.HasValue ? ri.CRATE.ToString() : ""; EQ.CASH_PAYMENT_AMT = ri.LNVAL.ToString(); EQ.BILLING_VALUE_AMT = ri.LNVAL.ToString(); EQ.BILLING_CURRENCY_CD = ""; EQ.COLLATERAL_DESC_CD = ""; if (ri.QTY > 0) { EQ.CONTRACT_PRICE_AMT = Math.Round(ri.LNVAL.Value / ri.QTY.Value, 6).ToString(); //EQ.CONTRACT_PRICE_AMT = (ri.LNVAL / ri.QTY).ToString(); } else { EQ.CONTRACT_PRICE_AMT = 0.ToString(); } EQ.COLLATERAL_MARGIN_PCT = ri.LNMRG.ToString(); EQ.CONTRACT_VALUE_AMT = ri.LNVAL.ToString(); EQ.TRADE_DT = ri.TRADE.HasValue ? ri.TRADE.Value.ToString("yyyyMMdd") : ""; EQ.COLLATERAL_DT = ""; EQ.TERM_DT = ri.TERMDT.HasValue ? ri.TERMDT.Value.ToString("yyyyMMdd") : EQ.TERM_DT; EQ.TERM_TYPE_CD = ""; EQ.HOLD_DT = ""; EQ.CALLABLE_DT = ""; EQ.RESET_INTERVAL_DAYS = ""; EQ.REBATE_RECEIVABLE_AMT = ""; EQ.REBATE_PAYABLE_AMT = ""; EQ.FEE_RECEIVABLE_AMT = ""; EQ.FEE_PAYABLE_AMT = ""; EQ.RATE_ADJUST_DT = ""; EQ.BUYIN_DT = ""; EQ.TERMINATION_IND = ""; EQ.BORROWER_SETTLE_INSTRUC_ID = ""; EQ.LENDER_SETTLE_INSTRUC_ID = ""; EQ.SETTLEMENT_TYPE_CD = ""; EQ.MARKING_PARAMETERS = ""; //Required EQ.INTERNAL_REF_ID = ri.BGNREF; EQ.COUNTERPARTY_REF_ID = ""; EQ.CORPORATE_ACTION_TYPE = ""; //Corp Actions EQ.EX_DT = ""; //Corp Actions EQ.RECORD_DT = ""; //Corp Actions EQ.INTERNAL_CUSTOM_FIELD = ""; EQ.EXTERNAL_CUSTOM_FIELD = ""; EQ.OLD_EQUILEND_TXN_ID = ""; EQ.BILLING_PRICE_AMT = ""; EQ.BILLING_MARGIN_PCT = ""; EQ.COLLATERAL_VALUE_AMT = ri.LNVAL.ToString(); EQ.EQUILEND_RETURN_ID = ""; EQ.RETURN_TRADE_DT = ""; EQ.RETURN_SETTLEMENT_DT = ""; EQ.EQUILEND_RECALL_ID = ""; EQ.RECALL_EFFECTIVE_DT = ""; EQ.RECALL_DUE_DT = ""; EQ.REASON_CD = ""; EQData.Add(EQ); } catch (Exception e) { throw; } } }
public EquilendExcelDataObjectTimeTable(EquilendExcelDataObjectGrid x) { this.EQUILEND_TXN_ID = x.EQUILEND_TXN_ID; this.LEGAL_ENTITY_ID = x.LEGAL_ENTITY_ID; this.CPTY_LEGAL_ENTITY_ID = x.CPTY_LEGAL_ENTITY_ID; this.BORROW_LOAN_TYPE_CD = x.BORROW_LOAN_TYPE_CD; this.SUBACCOUNT_ID = x.SUBACCOUNT_ID; this.SECURITY_ID = x.SECURITY_ID; this.SECURITY_ID_TYPE_CD = x.SECURITY_ID_TYPE_CD; this.RATE_TYPE_CD = x.RATE_TYPE_CD; this.RATE_AMT = x.RATE_AMT; this.FEE_TYPE_CD = x.FEE_TYPE_CD; this.FEE_AMT = x.FEE_AMT; this.DIVIDEND_RATE_PCT = x.DIVIDEND_RATE_PCT; this.DIVIDEND_TRACKING_IND = x.DIVIDEND_TRACKING_IND; this.COLLATERAL_TYPE_CD = x.COLLATERAL_TYPE_CD; this.BILLING_FX_RATE = x.BILLING_FX_RATE; this.BILLING_DERIVATION_IND = x.BILLING_DERIVATION_IND; this.COLLATERAL_CURRENCY_CD = x.COLLATERAL_CURRENCY_CD; this.CALLABLE_IND = x.CALLABLE_IND; this.SETTLEMENT_DT = x.SETTLEMENT_DT; this.COMPARE_RECORD_TYPE_CD = x.COMPARE_RECORD_TYPE_CD; this.UNIT_QTY = x.UNIT_QTY; this.ORDER_STATE_CD = x.ORDER_STATE_CD; this.PREPAY_RATE_PCT = x.PREPAY_RATE_PCT; this.CASH_PAYMENT_AMT = x.CASH_PAYMENT_AMT; this.BILLING_VALUE_AMT = x.BILLING_VALUE_AMT; this.BILLING_CURRENCY_CD = x.BILLING_CURRENCY_CD; this.COLLATERAL_DESC_CD = x.COLLATERAL_DESC_CD; this.CONTRACT_PRICE_AMT = x.CONTRACT_PRICE_AMT; this.COLLATERAL_MARGIN_PCT = x.COLLATERAL_MARGIN_PCT; this.CONTRACT_VALUE_AMT = x.CONTRACT_VALUE_AMT; this.TRADE_DT = x.TRADE_DT; this.COLLATERAL_DT = x.COLLATERAL_DT; this.TERM_DT = x.TERM_DT; this.TERM_TYPE_CD = x.TERM_TYPE_CD; this.HOLD_DT = x.HOLD_DT; this.CALLABLE_DT = x.CALLABLE_DT; this.RESET_INTERVAL_DAYS = x.RESET_INTERVAL_DAYS; this.REBATE_RECEIVABLE_AMT = x.REBATE_RECEIVABLE_AMT; this.REBATE_PAYABLE_AMT = x.REBATE_PAYABLE_AMT; this.FEE_RECEIVABLE_AMT = x.FEE_RECEIVABLE_AMT; this.FEE_PAYABLE_AMT = x.FEE_PAYABLE_AMT; this.RATE_ADJUST_DT = x.RATE_ADJUST_DT; this.BUYIN_DT = x.BUYIN_DT; this.TERMINATION_IND = x.TERMINATION_IND; this.BORROWER_SETTLE_INSTRUC_ID = x.BORROWER_SETTLE_INSTRUC_ID; this.LENDER_SETTLE_INSTRUC_ID = x.LENDER_SETTLE_INSTRUC_ID; this.SETTLEMENT_TYPE_CD = x.SETTLEMENT_TYPE_CD; this.MARKING_PARAMETERS = x.MARKING_PARAMETERS; this.INTERNAL_REF_ID = x.INTERNAL_REF_ID; this.COUNTERPARTY_REF_ID = x.COUNTERPARTY_REF_ID; this.CORPORATE_ACTION_TYPE = x.CORPORATE_ACTION_TYPE; this.EX_DT = x.EX_DT; this.RECORD_DT = x.RECORD_DT; this.INTERNAL_CUSTOM_FIELD = x.INTERNAL_CUSTOM_FIELD; this.EXTERNAL_CUSTOM_FIELD = x.EXTERNAL_CUSTOM_FIELD; this.OLD_EQUILEND_TXN_ID = x.OLD_EQUILEND_TXN_ID; this.BILLING_PRICE_AMT = x.BILLING_PRICE_AMT; this.BILLING_MARGIN_PCT = x.BILLING_MARGIN_PCT; this.COLLATERAL_VALUE_AMT = x.COLLATERAL_VALUE_AMT; this.EQUILEND_RETURN_ID = x.EQUILEND_RETURN_ID; this.RETURN_TRADE_DT = x.RETURN_TRADE_DT; this.RETURN_SETTLEMENT_DT = x.RETURN_SETTLEMENT_DT; this.EQUILEND_RECALL_ID = x.EQUILEND_RECALL_ID; this.RECALL_EFFECTIVE_DT = x.RECALL_EFFECTIVE_DT; this.RECALL_DUE_DT = x.RECALL_DUE_DT; this.REASON_CD = x.REASON_CD; this.TIMETABLE_ID = x.TIMETABLE_ID; }
public EquilendExcelDataObjectSingleCtpy(EquilendExcelDataObjectGrid x) { this.EQUILEND_TXN_ID = x.EQUILEND_TXN_ID; this.LEGAL_ENTITY_ID = x.LEGAL_ENTITY_ID; this.CPTY_LEGAL_ENTITY_ID = x.CPTY_LEGAL_ENTITY_ID; this.BORROW_LOAN_TYPE_CD = x.BORROW_LOAN_TYPE_CD; this.SUBACCOUNT_ID = x.SUBACCOUNT_ID; this.SECURITY_ID = x.SECURITY_ID; this.SECURITY_ID_TYPE_CD = x.SECURITY_ID_TYPE_CD; this.RATE_TYPE_CD = x.RATE_TYPE_CD; this.RATE_AMT = x.RATE_AMT; this.FEE_TYPE_CD = x.FEE_TYPE_CD; this.FEE_AMT = x.FEE_AMT; this.DIVIDEND_RATE_PCT = x.DIVIDEND_RATE_PCT; this.DIVIDEND_TRACKING_IND = x.DIVIDEND_TRACKING_IND; this.COLLATERAL_TYPE_CD = x.COLLATERAL_TYPE_CD; this.BILLING_FX_RATE = x.BILLING_FX_RATE; this.BILLING_DERIVATION_IND = x.BILLING_DERIVATION_IND; this.COLLATERAL_CURRENCY_CD = x.COLLATERAL_CURRENCY_CD; this.CALLABLE_IND = x.CALLABLE_IND; this.SETTLEMENT_DT = x.SETTLEMENT_DT; this.COMPARE_RECORD_TYPE_CD = x.COMPARE_RECORD_TYPE_CD; this.UNIT_QTY = x.UNIT_QTY; this.ORDER_STATE_CD = x.ORDER_STATE_CD; this.PREPAY_RATE_PCT = x.PREPAY_RATE_PCT; this.CASH_PAYMENT_AMT = x.CASH_PAYMENT_AMT; this.BILLING_VALUE_AMT = x.BILLING_VALUE_AMT; this.BILLING_CURRENCY_CD = x.BILLING_CURRENCY_CD; this.COLLATERAL_DESC_CD = x.COLLATERAL_DESC_CD; this.CONTRACT_PRICE_AMT = x.CONTRACT_PRICE_AMT; this.COLLATERAL_MARGIN_PCT = x.COLLATERAL_MARGIN_PCT; this.CONTRACT_VALUE_AMT = x.CONTRACT_VALUE_AMT; this.TRADE_DT = x.TRADE_DT; this.COLLATERAL_DT = x.COLLATERAL_DT; this.TERM_DT = x.TERM_DT; this.TERM_TYPE_CD = x.TERM_TYPE_CD; this.HOLD_DT = x.HOLD_DT; this.CALLABLE_DT = x.CALLABLE_DT; this.RESET_INTERVAL_DAYS = x.RESET_INTERVAL_DAYS; this.REBATE_RECEIVABLE_AMT = x.REBATE_RECEIVABLE_AMT; this.REBATE_PAYABLE_AMT = x.REBATE_PAYABLE_AMT; this.FEE_RECEIVABLE_AMT = x.FEE_RECEIVABLE_AMT; this.FEE_PAYABLE_AMT = x.FEE_PAYABLE_AMT; this.RATE_ADJUST_DT = x.RATE_ADJUST_DT; this.BUYIN_DT = x.BUYIN_DT; this.TERMINATION_IND = x.TERMINATION_IND; this.BORROWER_SETTLE_INSTRUC_ID = x.BORROWER_SETTLE_INSTRUC_ID; this.LENDER_SETTLE_INSTRUC_ID = x.LENDER_SETTLE_INSTRUC_ID; this.SETTLEMENT_TYPE_CD = x.SETTLEMENT_TYPE_CD; this.MARKING_PARAMETERS = x.MARKING_PARAMETERS; this.INTERNAL_REF_ID = x.INTERNAL_REF_ID; this.COUNTERPARTY_REF_ID = x.COUNTERPARTY_REF_ID; this.CORPORATE_ACTION_TYPE = x.CORPORATE_ACTION_TYPE; this.EX_DT = x.EX_DT; this.RECORD_DT = x.RECORD_DT; this.INTERNAL_CUSTOM_FIELD = x.INTERNAL_CUSTOM_FIELD; this.EXTERNAL_CUSTOM_FIELD = x.EXTERNAL_CUSTOM_FIELD; this.OLD_EQUILEND_TXN_ID = x.OLD_EQUILEND_TXN_ID; this.BILLING_PRICE_AMT = x.BILLING_PRICE_AMT; this.BILLING_MARGIN_PCT = x.BILLING_MARGIN_PCT; this.COLLATERAL_VALUE_AMT = x.COLLATERAL_VALUE_AMT; this.EQUILEND_RETURN_ID = x.EQUILEND_RETURN_ID; this.RETURN_TRADE_DT = x.RETURN_TRADE_DT; this.RETURN_SETTLEMENT_DT = x.RETURN_SETTLEMENT_DT; this.EQUILEND_RECALL_ID = x.EQUILEND_RECALL_ID; this.RECALL_EFFECTIVE_DT = x.RECALL_EFFECTIVE_DT; this.RECALL_DUE_DT = x.RECALL_DUE_DT; this.REASON_CD = x.REASON_CD; }