Beispiel #1
0
        public void GetNotes(string s)
        {
            db = new DatabaseLayer.DBConnection();
            string query = "SELECT * FROM File_Spring_17 WHERE CourseID=(SELECT CourseID FROM OfferedCourses_Spring_17 Where CourseName='" + s + "');";

            db.GetQuery(query);
            int       i = 0;
            DataTable t = new DataTable();

            db.dr.Dispose();
            db.dt.Fill(t);
            i = t.Columns.Count;

            for (int j = 1; j <= i; j++)
            {
                string query1 = "Select Note" + j.ToString() + " From File_Spring_17 Where CourseID=(Select CourseID From OfferedCourses_Spring_17 Where CourseName='" + s + "');";
                db = new DatabaseLayer.DBConnection();
                db.GetQuery(query1);
                db.dr.Dispose();
                db.dt.Fill(t);
                for (int a = 0; a < t.Columns.Count; a++)
                {
                    string sl = t.Columns[a].ToString();
                    hList.Add(sl);
                }
                db.dr.Dispose();
                db.dt.Dispose();
            }
        }
Beispiel #2
0
 public void getStudentRegistration(string getp, string s)
 {
     db = new DatabaseLayer.DBConnection();
     for (int i = 1; i < 8; i++)
     {
         string query = "SELECT Subject" + i.ToString() + " FROM Registration_151_" + s + " WHERE Id='" + getp + "';";
         db.GetQuery(query);
         if (db.dr.HasRows)
         {
             while (db.dr.Read())
             {
                 if (db.dr[0].ToString() != null)
                 {
                     try
                     {
                         string sl = db.dr.GetString(0);
                         courseList.Add(new Courses(sl));
                     }
                     catch (Exception ex)
                     {
                     }
                 }
             }
             db.dr.Dispose();
         }
     }
     db.con.Dispose();
     this.GetCourseList();
 }
Beispiel #3
0
        public void GetStudentInfo(string getp, Student stu)
        {
            db = new DatabaseLayer.DBConnection();
            string query = "Select * From Students_151 Where Id='" + getp + "';";

            db.GetQuery(query);
            if (db.dr.HasRows)
            {
                while (db.dr.Read())
                {
                    stu.Id      = db.dr.GetString(0);
                    stu.Name    = db.dr.GetString(2);
                    stu.Cgpa    = Convert.ToString(db.dr.GetDouble(3));
                    stu.Credit  = Convert.ToString(db.dr.GetInt32(4));
                    stu.Program = db.dr.GetString(5);
                    stu.Dept    = db.dr.GetString(6);
                    stu.Core    = db.dr.GetString(7);
                    if (db.dr[8].ToString() != null)
                    {
                        try
                        {
                            stu.Major = db.dr.GetString(8);


                            stu.SecondMajor = db.dr.GetString(9);
                            stu.Minor       = db.dr.GetString(10);
                        }
                        catch (Exception ex)
                        {
                            stu.Major       = "-";
                            stu.SecondMajor = "-";
                            stu.Minor       = "-";
                        }
                    }
                    stu.Elective         = db.dr.GetString(11);
                    stu.FatherName       = db.dr.GetString(12);
                    stu.MotherName       = db.dr.GetString(13);
                    stu.PresentAddress   = db.dr.GetString(14);
                    stu.PermanentAddress = db.dr.GetString(15);
                    stu.PhoneNo          = (db.dr.GetString(16));
                    stu.Email            = db.dr.GetString(17);
                    stu.DateOfBirth      = db.dr.GetString(18);
                    stu.Sex            = db.dr.GetString(19);
                    stu.Nationality    = db.dr.GetString(20);
                    stu.Religion       = db.dr.GetString(21);
                    stu.MaritalStatus  = db.dr.GetString(22);
                    stu.Blood          = db.dr.GetString(23);
                    stu.AdmissionDate  = db.dr.GetString(24);
                    stu.GraduationDate = db.dr.GetString(25);
                }
                db.dr.Dispose();
            }
            else
            {
                db.dr.Dispose();
            }
        }
Beispiel #4
0
 public void GetCourseList()
 {
     db = new DatabaseLayer.DBConnection();
     for (int i = 0; i < courseList.Count; i++)
     {
         string query = "SELECT * FROM OfferedCourses_Spring_17 WHERE CourseName='" + courseList[i].courseName + "';";
         db.GetQuery(query);
         if (db.dr.HasRows)
         {
             while (db.dr.Read())
             {
                 courseList[i].SetValue(db.dr.GetString(0), db.dr.GetString(2),
                                        db.dr.GetString(3), db.dr.GetString(5), db.dr.GetString(5), db.dr.GetString(6));
             }
             db.dr.Dispose();
         }
     }
     db.con.Dispose();
 }