Ejemplo n.º 1
0
        private static void AppendToWorksheet(JObject queryResponse, JToken queryData)
        {
            if (validateQueryData("AppendToWorksheet", queryData, new string[] { "securities" }, new string[] { "name", "id" }, queryResponse))
            {
                List <string> securities = new List <string>();
                foreach (string a in queryData["securities"])
                {
                    securities.Add(a);
                }

                string worksheetId = resolveWorksheetId(queryData, queryResponse);
                if (worksheetId != null)
                {
                    BlpWorksheet worksheet = BlpTerminal.GetWorksheet(worksheetId);
                    if (worksheet != null)
                    {
                        worksheet.AppendSecurities(securities);
                        queryResponse.Add("status", true);
                        queryResponse.Add("worksheet", renderWorksheet(worksheet, true));
                    }
                    else
                    {
                        queryResponse.Add("status", false);
                        queryResponse.Add("message", "Worksheet with id '" + worksheetId + "' not found");
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private static void GetWorksheet(JObject queryResponse, JToken queryData)
 {
     if (validateQueryData("GetWorksheet", queryData, null, new string[] { "name", "id" }, queryResponse))
     {
         string worksheetId = resolveWorksheetId(queryData, queryResponse);
         if (worksheetId != null)
         {
             BlpWorksheet worksheet = BlpTerminal.GetWorksheet(worksheetId);
             if (worksheet != null)
             {
                 queryResponse.Add("status", true);
                 queryResponse.Add("worksheet", renderWorksheet(worksheet, true));
             }
             else
             {
                 queryResponse.Add("status", false);
                 queryResponse.Add("message", "Worksheet with id '" + worksheetId + "' not found");
             }
         }
     }
 }