Example #1
0
        //ROUTE: ../plugin/labs
        public static string labs(string context_id)
        {
            // This can be retrieved from a database, or by contacting the laboratory
            // in case it manages more than one laboratory.

            lab lab1 = new lab
            {
                laboratory_id = "Sample_lab_1",
                autoload      = false,
                name          = "Sample Laborytory 1",
                description   = "This is an example of laboratory"
            };
            lab lab2 = new lab
            {
                laboratory_id = "Sample_lab_1",
                autoload      = true,
                name          = "Sample Laborytory 2",
                description   = "This is an example of laboratory"
            };

            labsList ListOfLabs = new labsList {
                labs = new lab[] { lab1, lab2 }
            };

            var    javaScriptSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            string jsonString           = javaScriptSerializer.Serialize(ListOfLabs);

            return(jsonString);
        }
Example #2
0
        //ROUTE: ../plugin/labs
        public static string labs(string context_id)
        {
            // This can be retrieved from a database, or by contacting the laboratory
            // in case it manages more than one laboratory.

            lab lab1 = new lab
            {
                laboratory_id = "Sample_lab_1",
                autoload = false,
                name = "Sample Laborytory 1",
                description = "This is an example of laboratory"
            };
            lab lab2 = new lab
            {
                laboratory_id = "Sample_lab_1",
                autoload = true,
                name = "Sample Laborytory 2",
                description = "This is an example of laboratory"
            };

            labsList ListOfLabs = new labsList { labs = new lab[] { lab1, lab2 } };

            var javaScriptSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            string jsonString = javaScriptSerializer.Serialize(ListOfLabs);
            return jsonString;
        }