public JsonResult GetAllStudent()
        {
            List <StudentServiceReference.Student> lstStudent = null;
            string message = string.Empty;
            bool   status  = false;

            try
            {
                StudentServiceReference.StudentServiceClient studentService = new StudentServiceReference.StudentServiceClient();
                lstStudent = studentService.GetAllStudentDetail();
                if (lstStudent == null)
                {
                    status     = false;
                    lstStudent = new List <StudentServiceReference.Student>();
                    message    = "Due to some error data in not binding!";
                }
                else
                {
                    status  = true;
                    message = "Get all student information from database.";
                }
            }
            catch (Exception ex)
            {
                lstStudent = null;
                message    = "Due to some error data in not bunding!";
            }
            return(Json(new { resultData = lstStudent, outcome = status, message = message }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult UpdateStudentDetail(StudentServiceReference.Student student)
        {
            bool   status  = false;
            string message = string.Empty;

            StudentServiceReference.Student         studentObj = null;
            IList <StudentServiceReference.Student> lstStudent = null;

            StudentServiceReference.StudentServiceClient studentService = new StudentServiceReference.StudentServiceClient();
            studentObj = studentService.SaveStudentDetail(student.StudentID, student);
            if (studentObj != null && studentObj.StudentID > 0)
            {
                lstStudent = studentService.GetAllStudentDetail();
            }
            return(Json(new { resultData = lstStudent, outcome = status, message = message }, JsonRequestBehavior.AllowGet));
        }