Example #1
0
        public string GetDepartment()
        {
            StudentDataDataContext studentData = new StudentDataDataContext();
            string department = studentData.DepartmentTables.SingleOrDefault(s => s.DepartmentID == Convert.ToInt32(this.department)).DepartmentName;

            return(department);
        }
Example #2
0
        public StudentDataHandler(string id)
        {
            this.id = id;
            this.StudentDataContext = new StudentDataDataContext();
            var StudentInformation = from student in StudentDataContext.Test_StudentTables
                                     where student.ID == id
                                     select student;

            StudentInformation.ToList();
            foreach (var data in StudentInformation)
            {
                this.name   = data.Name;
                this.CGPA   = (double)data.CGPA;
                this.credit = data.Credits ?? 0;
                // this.program = data.Program;
                this.department = data.Department ?? 1;
                this.father     = data.FatherName;
                this.mother     = data.MotherName;
                this.phone      = data.Phone;
                this.email      = data.Email;
                this.bloodGroup = data.BloodGroup ?? 1;
                this.gender     = data.Gender ?? 1;
                this.dob        = data.DOB ?? DateTime.Now;
            }
        }