Exemplo n.º 1
0
        public Boolean AddNewStudent(IStudent student)
        {
            var newstudent = new StudentDB
            {
                MatricNumber = student.MatricNumber,
                DateOfBirth = student.DateOfBirth,
                DepartmentCode = student.DepartmentCode,
                Faculty = student.Faculty,
                FirstName = student.FastName,
                Gender = Convert.ToChar(student.Gender),
                GraduationYear = student.GraduationYear,
                LastName = student.LastName,
                MiddleName = student.MiddleName,
                Nationality = student.Nationality,
                YearAdmitted = student.YearAdmitted
            };

              Db.StudentDBs.InsertOnSubmit(newstudent);
              Db.SubmitChanges();

            return true;
        }
 partial void DeleteStudentDB(StudentDB instance);
 partial void UpdateStudentDB(StudentDB instance);
 partial void InsertStudentDB(StudentDB instance);
Exemplo n.º 5
0
        public IStudent MaptoIStudent(StudentDB student)
        {
            var newstudent = new Student
            {
                StudentId = student.studentId,
                MatricNumber = student.MatricNumber,
                DateOfBirth = DateTime.Parse(student.DateOfBirth.ToString()),
                DepartmentCode = student.DepartmentCode,
                Faculty = student.Faculty,
                FastName = student.FirstName,
                Gender = Convert.ToChar(student.Gender).ToString(),
                GraduationYear = student.GraduationYear,
                LastName = student.LastName,
                MiddleName = student.MiddleName,
                Nationality = student.Nationality,
                YearAdmitted = student.YearAdmitted
            };

            return newstudent;
        }