Beispiel #1
0
        public List <ViewResultGOM> GetStudentDetailsInThisGateway(int studentId)
        {
            Query = "SELECT * FROM Student AS s,Department as d WHERE s.StudentId='" + studentId + "' AND d.DepartmentId=s.DepartmentId";

            Command = new SqlCommand(Query, Connection);

            Connection.Open();

            Reader = Command.ExecuteReader();

            List <ViewResultGOM> StudentListAndResult = new List <ViewResultGOM>();

            while (Reader.Read())
            {
                ViewResultGOM studentInfo = new ViewResultGOM();

                //studentInfo.StudentId = Convert.ToInt32(Reader["StudentId"]);
                studentInfo.StudentRegNo = Reader["RegNo"].ToString();
                studentInfo.StudentName  = Reader["StudentName"].ToString();
                studentInfo.StudentEmail = Reader["StudentEmail"].ToString();
                //studentInfo.StudentDeptId = Convert.ToInt32(Reader["DepartmentId"]);
                studentInfo.StudentDeptName = Reader["DepartmentName"].ToString();
                //studentInfo.StudentDeptCode = Reader["DepartmentCode"].ToString();
                //studentInfo.CourseCode = Reader["CourseCode"].ToString();
                //studentInfo.CourseName = Reader["CourseName"].ToString();
                //studentInfo.Grade = Reader["Grade"].ToString();
                //student.StudentdeptName = Reader["DepartmentId"];

                StudentListAndResult.Add(studentInfo);
            }
            Connection.Close();
            Reader.Close();

            return(StudentListAndResult);
        }
Beispiel #2
0
        public ActionResult PrintResultSheet(ViewResultGOM result)
        {
            List <ViewResultGOM> studentResult = ShowStudentDetailsById(result.StudentId);

            ViewBag.studentResult = studentResult;

            return(View());
        }
Beispiel #3
0
        public List <ViewResultGOM> ShowStudentDetailsById(int studentId)
        {
            Query = "SELECT * FROM StudentResultVw WHERE StudentId='" + studentId + "'";

            //Query = "Select s.StudentId,s.StudentName,s.RegNo,s.StudentEmail,d.DepartmentName,c.CourseCode,c.CourseName,sr.Grade FROM StudentResult AS sr,Student AS s,Course As c,Department AS d WHERE s.StudentId=sr.StudentId AND c.CourseId=sr.CourseId AND c.DepartmentId=d.DepartmentId AND s.StudentId='"+studentId+"'";
            //Query = "SELECT * FROM Student AS s,Department AS d,StudentResult AS sr,Course AS c WHERE s.DepartmentId=d.DepartmentId AND s.StudentId=sr.StudentId AND c.CourseId=sr.CourseId AND s.StudentId='"+studentId+"' ORDER BY s.RegNo";

            Command = new SqlCommand(Query, Connection);

            Connection.Open();

            Reader = Command.ExecuteReader();

            List <ViewResultGOM> StudentListAndResult = new List <ViewResultGOM>();

            string msg = "";

            DateTime d = DateTime.Now;

            while (Reader.Read())
            {
                ViewResultGOM studentInfo = new ViewResultGOM();

                studentInfo.StudentId    = Convert.ToInt32(Reader["StudentId"]);
                studentInfo.StudentRegNo = Reader["RegNo"].ToString();
                studentInfo.StudentName  = Reader["StudentName"].ToString();
                studentInfo.StudentEmail = Reader["StudentEmail"].ToString();
                //studentInfo.StudentDeptId = Convert.ToInt32(Reader["DepartmentId"]);
                studentInfo.StudentDeptName = Reader["DepartmentName"].ToString();
                //studentInfo.StudentDeptCode = Reader["DepartmentCode"].ToString();
                studentInfo.CourseCode = Reader["CourseCode"].ToString();
                studentInfo.CourseName = Reader["CourseName"].ToString();
                studentInfo.Grade      = Reader["Result"].ToString();

                studentInfo.PresentDate = d;

                //student.StudentdeptName = Reader["DepartmentId"];

                msg = studentInfo.Grade;

                StudentListAndResult.Add(studentInfo);
            }
            Connection.Close();
            Reader.Close();

            if (msg == "")
            {
                StudentListAndResult = GetStudentDetailsInThisGateway(studentId);
            }



            return(StudentListAndResult);
        }
Beispiel #4
0
        public List <ViewResultGOM> ShowStudentDetails()
        {
            //Query = "SELECT distinct s.RegNo,s.StudentId FROM Student AS s,Department AS d,StudentResult AS sr,Course AS c WHERE s.DepartmentId=d.DepartmentId AND s.StudentId=sr.StudentId AND c.CourseId=sr.CourseId ORDER BY s.RegNo";

            Query = "SELECT * FROM Student";

            Command = new SqlCommand(Query, Connection);

            Connection.Open();

            Reader = Command.ExecuteReader();

            List <ViewResultGOM> StudentListAndResult = new List <ViewResultGOM>();

            while (Reader.Read())
            {
                ViewResultGOM studentInfo = new ViewResultGOM();

                studentInfo.StudentId    = Convert.ToInt32(Reader["StudentId"]);
                studentInfo.StudentRegNo = Reader["RegNo"].ToString();
                //studentInfo.StudentName = Reader["StudentName"].ToString();
                //studentInfo.StudentEmail = Reader["StudentEmail"].ToString();
                //studentInfo.StudentDeptId = Convert.ToInt32(Reader["DepartmentId"]);
                //studentInfo.StudentDeptName = Reader["DepartmentName"].ToString();
                //studentInfo.StudentDeptCode = Reader["DepartmentCode"].ToString();
                //studentInfo.CourseCode = Reader["CourseCode"].ToString();
                //studentInfo.CourseName = Reader["CourseName"].ToString();
                //studentInfo.Grade = Reader["Grade"].ToString();

                //student.StudentdeptName = Reader["DepartmentId"];

                StudentListAndResult.Add(studentInfo);
            }
            Connection.Close();
            Reader.Close();
            return(StudentListAndResult);
        }