Example #1
0
        public HttpResponseMessage addStudentDetails(studentDetails studentDetails)
        {
            ReturnData rd = new ReturnData();

            rd = studentDetails.addStudentDetails();
            string yourJson = JsonConvert.SerializeObject(rd);;
            var    response = this.Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json");
            return(response);
        }
Example #2
0
        public HttpResponseMessage getStudentDetails(string user_id)
        {
            List <studentDetails> list = new List <studentDetails>();
            studentDetails        u    = new studentDetails();

            list = u.getStudentDetails(user_id);
            string yourJson = JsonConvert.SerializeObject(list);
            var    response = this.Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json");
            return(response);
        }
Example #3
0
        public HttpResponseMessage getStudentDetailsinlineFormUserID(string inlineFormUserID, string inlineFormUserName, string inlineFormEmailAddress, string inlineFormPhone)
        {
            List <studentDetails> list = new List <studentDetails>();
            studentDetails        c    = new studentDetails();

            list = c.getStudentDetailsinlineFormUserID(inlineFormUserID, inlineFormUserName, inlineFormEmailAddress, inlineFormPhone);
            string yourJson = JsonConvert.SerializeObject(list);;
            var    response = this.Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json");
            return(response);
        }