Ejemplo n.º 1
0
        public void Add(Student student)
        {
            lock (student)
            {
                if (Count == StudentId.Length)
                {
                    var newLength  = StudentId.Length + 1000;
                    var _StudentId = new string[newLength];
                    StudentId.CopyTo(_StudentId);
                    StudentId = _StudentId;
                    var _IndexNumber = new string[newLength];
                    IndexNumber.CopyTo(_IndexNumber);
                    IndexNumber = _IndexNumber;
                    var _ReferenceNumber = new string[newLength];
                    ReferenceNumber.CopyTo(_ReferenceNumber);
                    ReferenceNumber = _ReferenceNumber;
                    var _Surname = new string[newLength];
                    Surname.CopyTo(_Surname);
                    Surname = _Surname;
                    var _Othernames = new string[newLength];
                    Othernames.CopyTo(_Othernames);
                    Othernames = _Othernames;
                    var _Title = new string[newLength];
                    Title.CopyTo(_Title);
                    Title = _Title;
                    var _Gender = new string[newLength];
                    Gender.CopyTo(_Gender);
                    Gender = _Gender;
                    var _MaritalStatus = new string[newLength];
                    MaritalStatus.CopyTo(_MaritalStatus);
                    MaritalStatus = _MaritalStatus;
                    var _DateofBirth = new string[newLength];
                    DateofBirth.CopyTo(_DateofBirth);
                    DateofBirth = _DateofBirth;
                    var _Disability = new bool[newLength];
                    Disability.CopyTo(_Disability);
                    Disability = _Disability;
                    var _Country = new string[newLength];
                    Country.CopyTo(_Country);
                    Country = _Country;
                    var _Region = new string[newLength];
                    Region.CopyTo(_Region);
                    Region = _Region;
                    var _HomeTown = new string[newLength];
                    HomeTown.CopyTo(_HomeTown);
                    HomeTown = _HomeTown;
                    var _Address1 = new string[newLength];
                    Address1.CopyTo(_Address1);
                    Address1 = _Address1;
                    var _Address2 = new string[newLength];
                    Address2.CopyTo(_Address2);
                    Address2 = _Address2;
                    var _Contact1 = new string[newLength];
                    Contact1.CopyTo(_Contact1);
                    Contact1 = _Contact1;
                    var _Contact2 = new string[newLength];
                    Contact2.CopyTo(_Contact2);
                    Contact2 = _Contact2;
                    var _PersonalEmail = new string[newLength];
                    PersonalEmail.CopyTo(_PersonalEmail);
                    PersonalEmail = _PersonalEmail;
                    var _UniversityEmail = new string[newLength];
                    UniversityEmail.CopyTo(_UniversityEmail);
                    UniversityEmail = _UniversityEmail;
                    var _ResidentialStatus = new string[newLength];
                    ResidentialStatus.CopyTo(_ResidentialStatus);
                    ResidentialStatus = _ResidentialStatus;
                    var _ProgramOfStudy = new string[newLength];
                    ProgramOfStudy.CopyTo(_ProgramOfStudy);
                    ProgramOfStudy = _ProgramOfStudy;
                    var _Specialization = new string[newLength];
                    Specialization.CopyTo(_Specialization);
                    Specialization = _Specialization;
                    var _ProgramStatus = new string[newLength];
                    ProgramStatus.CopyTo(_ProgramStatus);
                    ProgramStatus = _ProgramStatus;
                    var _Level = new string[newLength];
                    Level.CopyTo(_Level);
                    Level = _Level;
                    var _StudentType = new string[newLength];
                    StudentType.CopyTo(_StudentType);
                    StudentType = _StudentType;
                    var _EnrollmentOption = new string[newLength];
                    EnrollmentOption.CopyTo(_EnrollmentOption);
                    EnrollmentOption = _EnrollmentOption;
                    var _RegistrationStatus = new string[newLength];
                    RegistrationStatus.CopyTo(_RegistrationStatus);
                    RegistrationStatus = _RegistrationStatus;
                    var _DateOfEntry = new System.DateTime[newLength];
                    DateOfEntry.CopyTo(_DateOfEntry);
                    DateOfEntry = _DateOfEntry;
                    var _DateOfCompletion = new System.DateTime[newLength];
                    DateOfCompletion.CopyTo(_DateOfCompletion);
                    DateOfCompletion = _DateOfCompletion;
                    var _Results = new StudentResultDM[newLength];;
                    Results.CopyTo(_Results);
                    Results = _Results;
                    var _RegisteredCourses = new RegisteredCourseDM[newLength];
                    RegisteredCourses.CopyTo(_RegisteredCourses);
                    RegisteredCourses = _RegisteredCourses;
                    var _EmergencyContact = new EmergencyContactDM[newLength];
                    EmergencyContact.CopyTo(_EmergencyContact);
                    EmergencyContact = _EmergencyContact;
                    var _Owning = new bool[newLength];
                    //Owning.CopyTo(_Owning);
                    //Owning = _Owning;
                    //var _FeesBalance = new string[newLength];
                    //FeesBalance.CopyTo(_FeesBalance);
                    //FeesBalance = _FeesBalance;
                    var _PamentOption = new string[newLength];
                    PamentOption.CopyTo(_PamentOption);
                    PamentOption = _PamentOption;
                    var _DepartmentId = new string[newLength];
                    DepartmentId.CopyTo(_DepartmentId);
                    DepartmentId = _DepartmentId;
                    var _State = new int[newLength];
                    State.CopyTo(_State);
                    State = _State;
                }
                StudentId.Span[Count]          = student.StudentId;
                IndexNumber.Span[Count]        = student.IndexNumber;
                ReferenceNumber.Span[Count]    = student.ReferenceNumber;
                Surname.Span[Count]            = student.Surname;
                Othernames.Span[Count]         = student.Othernames;
                Title.Span[Count]              = student.Title;
                Gender.Span[Count]             = student.Gender;
                MaritalStatus.Span[Count]      = student.MaritalStatus;
                DateofBirth.Span[Count]        = student.DateofBirth;
                Disability.Span[Count]         = student.Disability;
                Country.Span[Count]            = student.Country;
                Region.Span[Count]             = student.Region;
                HomeTown.Span[Count]           = student.HomeTown;
                Address1.Span[Count]           = student.Address1;
                Address2.Span[Count]           = student.Address2;
                Contact1.Span[Count]           = student.Contact1;
                Contact2.Span[Count]           = student.Contact2;
                PersonalEmail.Span[Count]      = student.PersonalEmail;
                UniversityEmail.Span[Count]    = student.UniversityEmail;
                ResidentialStatus.Span[Count]  = student.ResidentialStatus;
                ProgramOfStudy.Span[Count]     = student.ProgramOfStudy;
                Specialization.Span[Count]     = student.Specialization;
                ProgramStatus.Span[Count]      = student.ProgramStatus;
                Level.Span[Count]              = student.Level;
                StudentType.Span[Count]        = student.StudentType;
                EnrollmentOption.Span[Count]   = student.EnrollmentOption;
                RegistrationStatus.Span[Count] = student.RegistrationStatus;
                DateOfEntry.Span[Count]        = student.DateOfEntry;
                DateOfCompletion.Span[Count]   = student.DateOfCompletion;

                //Owning.Span[Count] = student.Owning;
                //FeesBalance.Span[Count] = student.FeesBalance;
                PamentOption.Span[Count] = student.PamentOption;
                DepartmentId.Span[Count] = student.DepartmentId;
                State.Span[Count]++;
                Count++;

                Results.Span[Count] = new StudentResultDM(length);
                if (student.Results?.Count > 0)
                {
                    foreach (var t in student.Results)
                    {
                        Results.Span[Count].Add(t);
                    }
                }

                EmergencyContact.Span[Count] = new EmergencyContactDM(length);
                if (student.EmergencyContact?.Count > 0)
                {
                    foreach (var t in student.EmergencyContact)
                    {
                        EmergencyContact.Span[Count].Add(t);
                    }
                }

                RegisteredCourses.Span[Count] = new RegisteredCourseDM(length);
                if (student.RegisteredCourses?.Count > 0)
                {
                    foreach (var t in student.RegisteredCourses)
                    {
                        RegisteredCourses.Span[Count].Add(t);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void Add(MountedCourse type)
        {
            lock (type)
            {
                if (Count == MountedCoureId.Length)
                {
                    var newLength       = MountedCoureId.Length + 1000;
                    var _MountedCoureId = new string[newLength];
                    MountedCoureId.CopyTo(_MountedCoureId);
                    MountedCoureId = _MountedCoureId;
                    var _EnrollmentOption = new string[newLength];
                    EnrollmentOption.CopyTo(_EnrollmentOption);
                    EnrollmentOption = _EnrollmentOption;
                    var _Level = new string[newLength];
                    Level.CopyTo(_Level);
                    Level = _Level;
                    var _MaxLimit = new int[newLength];
                    MaxLimit.CopyTo(_MaxLimit);
                    MaxLimit = _MaxLimit;
                    var _MinLimit = new int[newLength];
                    MinLimit.CopyTo(_MinLimit);
                    MinLimit = _MinLimit;
                    var _Semester = new string[newLength];
                    Semester.CopyTo(_Semester);
                    Semester = _Semester;
                    var _AcademicYear = new string[newLength];
                    AcademicYear.CopyTo(_AcademicYear);
                    AcademicYear = _AcademicYear;
                    var _ProgramId = new string[newLength];
                    ProgramId.CopyTo(_ProgramId);
                    ProgramId = _ProgramId;
                    var _AssignedBy = new string[newLength];
                    AssignedBy.CopyTo(_AssignedBy);
                    AssignedBy = _AssignedBy;
                    var _Date = new System.DateTime[newLength];
                    Date.CopyTo(_Date);
                    Date = _Date;
                    var _CourseName = new string[newLength];
                    CourseName.CopyTo(_CourseName);
                    CourseName = _CourseName;
                    var _CourseCode = new string[newLength];
                    CourseCode.CopyTo(_CourseCode);
                    CourseCode = _CourseCode;
                    var _AssignedTo = new string[newLength];
                    AssignedTo.CopyTo(_AssignedTo);
                    AssignedTo = _AssignedTo;
                    var _Specialization = new string[newLength];
                    Specialization.CopyTo(_Specialization);
                    Specialization = _Specialization;
                    var _Category = new string[newLength];
                    Category.CopyTo(_Category);
                    Category = _Category;
                    var _Scoring = new bool[newLength];
                    Scoring.CopyTo(_Scoring);
                    Scoring = _Scoring;
                    var _Credit = new int[newLength];
                    Credit.CopyTo(_Credit);
                    Credit = _Credit;
                }

                MountedCoureId.Span[Count]   = type.MountedCoureId;
                EnrollmentOption.Span[Count] = type.EnrollmentOption;
                Level.Span[Count]            = type.Level;
                MaxLimit.Span[Count]         = type.MaxLimit;
                MinLimit.Span[Count]         = type.MinLimit;
                Semester.Span[Count]         = type.Semester;
                AcademicYear.Span[Count]     = type.AcademicYear;
                ProgramId.Span[Count]        = type.ProgramId;
                AssignedBy.Span[Count]       = type.AssignedBy;
                Date.Span[Count]             = type.Date;
                CourseName.Span[Count]       = type.CourseName;
                CourseCode.Span[Count]       = type.CourseCode;
                AssignedTo.Span[Count]       = type.AssignedTo;
                Specialization.Span[Count]   = type.Specialization;
                Category.Span[Count]         = type.Category;
                Scoring.Span[Count]          = type.Scoring;
                Credit.Span[Count]           = type.Credit;
                Count++;
            }
        }