Esempio n. 1
0
        ResponseBondData GetBondDic()
        {
            ResponseBondData result = new ResponseBondData();

            try
            {
                var bonds = DataLayer.Repository.GetBonds();
                foreach (Bond b in bonds)
                {
                    result.BondDic[b.Id] = b;
                }
                DataLayer.Repository.BondDic = result.BondDic;
            }
            catch (Exception ex)
            {
                while (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }

                result.Error         = new CustomException();
                result.Error.Message = ex.Message + ex.StackTrace;
            }

            //we read from the database from te table Currencies
            // assumption is - if ClassName is not null then the rest of the parameters for each currency should be populated for Quantlib
            // otherwise it was manually added and everything should be coming from the database only

            return(result);
        }
Esempio n. 2
0
        public string GetBond(string id)
        {
            long idBond = JsonConvert.DeserializeObject <Int32>(id);

            ResponseBondData tmp = GetBondDic();

            return(JsonConvert.SerializeObject(tmp.BondDic[idBond]));
        }
Esempio n. 3
0
        public string GetBonds()
        {
            ResponseBondData tmp = GetBondDic();

            return(JsonConvert.SerializeObject(tmp));
        }