public MemoryLookupValues() { Frequencies = _lookupBusiness.GetFreqTypeAll(); Products = _lookupBusiness.GetProductAll(); Statuses = _lookupBusiness.GetStatusAll(); Portfolios = _lookupBusiness.GetPortfolioAll(); Limits = _lookupBusiness.GetLimitAll(); Currencies = _lookupBusiness.GetCurrencyAll(); }
public static object GetFreqTypeOptions(SessionInfo sessioninfo) { try { LookupBusiness _lookupBusiness = new LookupBusiness(); //Get data from database var freqtypes = _lookupBusiness.GetFreqTypeAll().OrderBy(p => p.INDEX).Select(c => new { DisplayText = c.LABEL, Value = c.ID }); //Return result to jTable return(new { Result = "OK", Options = freqtypes }); } catch (Exception ex) { return(new { Result = "ERROR", Message = ex.Message }); } }
public static List<DealViewModel> GetDealInquiryData(SessionInfo sessioninfo , string strDMKNo , string strOPICNo , string strProduct , string strCtpy , string strPortfolio , string strTradeDate , string strEffDate , string strMatDate , string strInstrument , string strUser , string strStatus , string strOverStatus , string strProcDate , string strSettleStatus) { DealBusiness _dealBusiness = new DealBusiness(); UserBusiness _userBusiness = new UserBusiness(); LookupBusiness _lookupBusiness = new LookupBusiness(); //Get data from database List<DA_TRN> trns = _dealBusiness.GetDealInquiryByFilter(sessioninfo , strDMKNo , strOPICNo , strProduct , strCtpy , strPortfolio , strTradeDate , strEffDate , strMatDate , strInstrument , strUser , strStatus , strProcDate); //Get user data List<MA_USER> users = _userBusiness.GetAll(); List<MA_CURRENCY> ccys = _lookupBusiness.GetCurrencyAll(); List<MA_FREQ_TYPE> freq = _lookupBusiness.GetFreqTypeAll(); return (from t in trns join user in users on t.LOG.INSERTBYUSERID equals user.ID into ljuser from inputuser in ljuser.DefaultIfEmpty() join tempccy1 in ccys on t.FIRST.CCY_ID equals tempccy1.ID into ljccy1 from ccy1 in ljccy1.DefaultIfEmpty() join tempccy2 in ccys on t.SECOND.CCY_ID equals tempccy2.ID into ljccy2 from ccy2 in ljccy2.DefaultIfEmpty() join f1 in freq on t.FIRST.FREQTYPE_ID equals f1.ID into fg1 from subfg1 in fg1.DefaultIfEmpty() join f2 in freq on t.SECOND.FREQTYPE_ID equals f2.ID into fg2 from subfg2 in fg2.DefaultIfEmpty() select new DealViewModel { ID = t.ID, EntryDate = t.LOG.INSERTDATE, DMK_NO = t.INT_DEAL_NO, OPICS_NO = t.EXT_DEAL_NO, TradeDate = t.TRADE_DATE.Value, EffectiveDate = t.START_DATE, Instrument = t.MA_INSRUMENT.LABEL, MaturityDate = t.MATURITY_DATE, BuySell = t.FLAG_BUYSELL, Product = t.MA_PRODUCT.LABEL, Portfolio = t.MA_PORTFOLIO.LABEL, Counterparty = t.MA_COUTERPARTY.SNAME, Notional1 = t.FIRST.NOTIONAL, PayRec1 = t.FIRST.FLAG_PAYREC, FixedFloat1 = !t.FIRST.FLAG_FIXED.HasValue ? null : t.FIRST.FLAG_FIXED.Value ? "FIXED" : "FLOAT", Rate1 = t.FIRST.RATE, Fixing1 = t.FIRST.FIRSTFIXINGAMT, SwapPoint1 = t.FIRST.SWAP_POINT, Notional2 = t.SECOND.NOTIONAL, PayRec2 = t.SECOND.FLAG_PAYREC, FixedFloat2 = !t.SECOND.FLAG_FIXED.HasValue ? null : t.SECOND.FLAG_FIXED == true ? "FIXED" : "FLOAT", Rate2 = t.SECOND.RATE, Fixing2 = t.SECOND.FIRSTFIXINGAMT, SwapPoint2 = t.SECOND.SWAP_POINT, Status = t.MA_STATUS.LABEL, KKContribute = t.KK_CONTRIBUTE, BotContribute = t.BOT_CONTRIBUTE , LimitOverwrite = string.IsNullOrEmpty(t.OVER_APPROVER) ? "No" : t.OVER_AMOUNT > 0 && t.OVER_SETTL_AMOUNT > 0 ? "Yes" : t.OVER_AMOUNT > 0 ? "PCE" : "SET", LimitApprover = t.OVER_APPROVER, Trader = inputuser != null ? inputuser.USERCODE : null, Remark = t.REMARK, CCY1 = ccy1 != null ? ccy1.LABEL : null, CCY2 = ccy2 != null ? ccy2.LABEL : null, SettlementLimit = !t.FLAG_SETTLE.HasValue || !t.FLAG_SETTLE.Value ? "No" : "Yes", Freq1 = subfg1 != null ? subfg1.USERCODE : null, Freq2 = subfg2 != null ? subfg2.USERCODE : null, OpicsTrader = t.INSERT_BY_EXT, TBMA_SENT = t.DA_TMBA_EXTENSION == null ? "N/A" : t.DA_TMBA_EXTENSION.SEND_DATE != null ? "Yes" : "No" }).Where(p => p.LimitOverwrite == strOverStatus || String.IsNullOrEmpty(strOverStatus)) .Where(t => t.SettlementLimit == strSettleStatus || string.IsNullOrEmpty(strSettleStatus)).ToList(); }
public static object GetFreqTypeOptions(SessionInfo sessioninfo) { try { LookupBusiness _lookupBusiness = new LookupBusiness(); //Get data from database var freqtypes = _lookupBusiness.GetFreqTypeAll().OrderBy(p => p.INDEX).Select(c => new { DisplayText = c.LABEL, Value = c.ID }); //Return result to jTable return new { Result = "OK", Options = freqtypes }; } catch (Exception ex) { return new { Result = "ERROR", Message = ex.Message }; } }
public static List <DealViewModel> GetDealInquiryData(SessionInfo sessioninfo , string strDMKNo , string strOPICNo , string strProduct , string strCtpy , string strPortfolio , string strTradeDate , string strEffDate , string strMatDate , string strInstrument , string strUser , string strStatus , string strOverStatus , string strProcDate , string strSettleStatus) { DealBusiness _dealBusiness = new DealBusiness(); UserBusiness _userBusiness = new UserBusiness(); LookupBusiness _lookupBusiness = new LookupBusiness(); //Get data from database List <DA_TRN> trns = _dealBusiness.GetDealInquiryByFilter(sessioninfo , strDMKNo , strOPICNo , strProduct , strCtpy , strPortfolio , strTradeDate , strEffDate , strMatDate , strInstrument , strUser , strStatus , strProcDate); //Get user data List <MA_USER> users = _userBusiness.GetAll(); List <MA_CURRENCY> ccys = _lookupBusiness.GetCurrencyAll(); List <MA_FREQ_TYPE> freq = _lookupBusiness.GetFreqTypeAll(); return((from t in trns join user in users on t.LOG.INSERTBYUSERID equals user.ID into ljuser from inputuser in ljuser.DefaultIfEmpty() join tempccy1 in ccys on t.FIRST.CCY_ID equals tempccy1.ID into ljccy1 from ccy1 in ljccy1.DefaultIfEmpty() join tempccy2 in ccys on t.SECOND.CCY_ID equals tempccy2.ID into ljccy2 from ccy2 in ljccy2.DefaultIfEmpty() join f1 in freq on t.FIRST.FREQTYPE_ID equals f1.ID into fg1 from subfg1 in fg1.DefaultIfEmpty() join f2 in freq on t.SECOND.FREQTYPE_ID equals f2.ID into fg2 from subfg2 in fg2.DefaultIfEmpty() select new DealViewModel { ID = t.ID, EntryDate = t.LOG.INSERTDATE, DMK_NO = t.INT_DEAL_NO, OPICS_NO = t.EXT_DEAL_NO, TradeDate = t.TRADE_DATE.Value, EffectiveDate = t.START_DATE, Instrument = t.MA_INSRUMENT.LABEL, MaturityDate = t.MATURITY_DATE, BuySell = t.FLAG_BUYSELL, Product = t.MA_PRODUCT.LABEL, Portfolio = t.MA_PORTFOLIO.LABEL, Counterparty = t.MA_COUTERPARTY.SNAME, Notional1 = t.FIRST.NOTIONAL, PayRec1 = t.FIRST.FLAG_PAYREC, FixedFloat1 = !t.FIRST.FLAG_FIXED.HasValue ? null : t.FIRST.FLAG_FIXED.Value ? "FIXED" : "FLOAT", Rate1 = t.FIRST.RATE, Fixing1 = t.FIRST.FIRSTFIXINGAMT, SwapPoint1 = t.FIRST.SWAP_POINT, Notional2 = t.SECOND.NOTIONAL, PayRec2 = t.SECOND.FLAG_PAYREC, FixedFloat2 = !t.SECOND.FLAG_FIXED.HasValue ? null : t.SECOND.FLAG_FIXED == true ? "FIXED" : "FLOAT", Rate2 = t.SECOND.RATE, Fixing2 = t.SECOND.FIRSTFIXINGAMT, SwapPoint2 = t.SECOND.SWAP_POINT, Status = t.MA_STATUS.LABEL, KKContribute = t.KK_CONTRIBUTE, BotContribute = t.BOT_CONTRIBUTE, LimitOverwrite = string.IsNullOrEmpty(t.OVER_APPROVER) ? "No" : t.OVER_AMOUNT > 0 && t.OVER_SETTL_AMOUNT > 0 ? "Yes" : t.OVER_AMOUNT > 0 ? "PCE" : "SET", LimitApprover = t.OVER_APPROVER, Trader = inputuser != null ? inputuser.USERCODE : null, Remark = t.REMARK, CCY1 = ccy1 != null ? ccy1.LABEL : null, CCY2 = ccy2 != null ? ccy2.LABEL : null, SettlementLimit = !t.FLAG_SETTLE.HasValue || !t.FLAG_SETTLE.Value ? "No" : "Yes", Freq1 = subfg1 != null ? subfg1.USERCODE : null, Freq2 = subfg2 != null ? subfg2.USERCODE : null, OpicsTrader = t.INSERT_BY_EXT, TBMA_SENT = t.DA_TMBA_EXTENSION == null ? "N/A" : t.DA_TMBA_EXTENSION.SEND_DATE != null ? "Yes" : "No" }).Where(p => p.LimitOverwrite == strOverStatus || String.IsNullOrEmpty(strOverStatus)) .Where(t => t.SettlementLimit == strSettleStatus || string.IsNullOrEmpty(strSettleStatus)).ToList()); }
public static object GetDealByProcessDateStatusCode(SessionInfo sessioninfo, DateTime processdate, StatusCode statuscode, int startIndex, int count, string sorting) { DealBusiness _dealBusiness = new DealBusiness(); OpicsBusiness _opicsBusiness = new OpicsBusiness(); LookupBusiness _lookupBusiness = new LookupBusiness(); List<DA_TRN> deals = null; List<DA_TRN> dealExts = null; List<DEALModel> opicdeals = null; try { //Get data from database if (statuscode == StatusCode.MATCHED) { LoggingHelper.Debug("Get DMK Deal is matched on " + processdate.ToString()); deals = _dealBusiness.GetDealByProcessDate(processdate, StatusCode.MATCHED); dealExts = _dealBusiness.GetImportedDealsByProcessDate(sessioninfo.Process.NextDate); } else { LoggingHelper.Debug("Get DMK Deal is not matched on " + processdate.ToString()); //Get data from database opicdeals = _opicsBusiness.GetOPICSDealExternal(processdate); //auto match with OPICS deal AutoMatchAndUpdateDeals(sessioninfo, processdate, opicdeals, out deals); } if (dealExts == null) dealExts = new List<DA_TRN>(); List<MA_FREQ_TYPE> freq = _lookupBusiness.GetFreqTypeAll(); List<MA_CURRENCY> ccys = _lookupBusiness.GetCurrencyAll(); //Sorting string[] sortsp = sorting.Split(' '); List<DealViewModel> dealviews = (from t in deals join p in dealExts on new { t.INT_DEAL_NO, t.FLAG_NEARFAR } equals new { p.INT_DEAL_NO, p.FLAG_NEARFAR } into ps join f1 in freq on t.FIRST.FREQTYPE_ID equals f1.ID into fg1 from subfg1 in fg1.DefaultIfEmpty() join f2 in freq on t.SECOND.FREQTYPE_ID equals f2.ID into fg2 from subfg2 in fg2.DefaultIfEmpty() join tempccy1 in ccys on t.FIRST.CCY_ID equals tempccy1.ID into ljccy1 from ccy1 in ljccy1.DefaultIfEmpty() join tempccy2 in ccys on t.SECOND.CCY_ID equals tempccy2.ID into ljccy2 from ccy2 in ljccy2.DefaultIfEmpty() where t.MA_STATUS.LABEL.Contains(statuscode.ToString()) && t.MATURITY_DATE.HasValue ? t.MATURITY_DATE.Value > sessioninfo.Process.CurrentDate : true select new DealViewModel { ID = t.ID, EntryDate = t.LOG.INSERTDATE, DMK_NO = t.INT_DEAL_NO, OPICS_NO = ps == null ? t.EXT_DEAL_NO : string.Join(",", ps.Select(i => i.EXT_DEAL_NO)), TradeDate = t.TRADE_DATE.Value, EffectiveDate = t.START_DATE, Instrument = t.MA_INSRUMENT.LABEL, MaturityDate = t.MATURITY_DATE.HasValue ? t.MATURITY_DATE : null, BuySell = t.FLAG_BUYSELL, Product = t.MA_PRODUCT.LABEL, Portfolio = t.MA_PORTFOLIO.LABEL, Counterparty = t.MA_COUTERPARTY.SNAME, Notional1 = t.FIRST.NOTIONAL, PayRec1 = t.FIRST.FLAG_PAYREC, FixedFloat1 = !t.FIRST.FLAG_FIXED.HasValue ? null : t.FIRST.FLAG_FIXED == true ? "FIXED" : "FLOAT", Fixing1 = t.FIRST.FIRSTFIXINGAMT, Rate1 = t.FIRST.RATE, SwapPoint1 = t.FIRST.SWAP_POINT, Notional2 = t.SECOND.NOTIONAL, PayRec2 = t.SECOND.FLAG_PAYREC, FixedFloat2 = !t.SECOND.FLAG_FIXED.HasValue ? null : t.SECOND.FLAG_FIXED == true ? "FIXED" : "FLOAT", Fixing2 = t.SECOND.FIRSTFIXINGAMT, Rate2 = t.SECOND.RATE, SwapPoint2 = t.SECOND.SWAP_POINT, Status = t.MA_STATUS.LABEL, KKContribute = t.KK_CONTRIBUTE, BotContribute = t.BOT_CONTRIBUTE, Remark = t.REMARK, Freq1 = subfg1 != null ? subfg1.USERCODE : null, Freq2 = subfg2 != null ? subfg2.USERCODE : null, CCY1 = ccy1 != null ? ccy1.LABEL : null, CCY2 = ccy2 != null ? ccy2.LABEL : null }).AsQueryable().OrderBy(sortsp[0], sortsp[1]).ToList(); //Return result to jTable return new { Result = "OK", Records = dealviews.Count > 0 ? dealviews.Skip(startIndex).Take(count).ToList() : dealviews, TotalRecordCount = dealviews.Count }; } catch (Exception ex) { return new { Result = "ERROR", Message = ex.Message }; } }