Example #1
0
        public EntrantApplication(
            Entrant Entrant,
            int ApplicationNumber,
            DateTime RegistrationDate,
            bool NeedHostel,
            string StatusApp,
            CompetitiveGroup CompetitiveGroup,
            int ReturnDocumentsType,

            FinSourceAndEduForms FinSourceAndEduForms,
            ObservableCollection <Document> ApplicationDocuments,
            ObservableCollection <EntranceTestResults> EntranceTestResults,
            ObservableCollection <InstitutionAchievement> InstitutionAchievments,
            bool Original)
        {
            this.Entrant                = Entrant;
            this.ApplicationNumber      = ApplicationNumber;
            this.RegistrationDate       = RegistrationDate;
            this.NeedHostel             = NeedHostel;
            this.StatusApp              = StatusApp;
            this.CompetitiveGroup       = CompetitiveGroup;
            this.ReturnDocumentsType    = ReturnDocumentsType;
            this.FinSourceAndEduForms   = FinSourceAndEduForms;
            this.ApplicationDocuments   = ApplicationDocuments;
            this.EntranceTestResults    = EntranceTestResults;
            this.InstitutionAchievments = InstitutionAchievments;
            this.Original               = Original;
        }
Example #2
0
 public void Create(Entrant Entrant)
 {
     if ((!db.Entrants.Any(x => (x.Person == Entrant.Person))) &&
         (repositoryPerson.Existed(Entrant.Person)))
     {
         db.Entrants.Add(Entrant);
     }
     ;
 }
Example #3
0
        public ObservableCollection <EntrantApplication> GetApplicationsEntrant(Entrant entrant)
        {
            ObservableCollection <EntrantApplication> ApplicationsEntrant = new ObservableCollection <EntrantApplication>();
            ObservableCollection <EntrantApplication> AllApps             = repositoryApplication.GetAll();

            foreach (EntrantApplication application in AllApps)
            {
                if (application.Entrant == entrant)
                {
                    ApplicationsEntrant.Add(application);
                }
            }
            return(ApplicationsEntrant);
        }
Example #4
0
        // public ObservableCollection<Document> EntrantDocuments = new ObservableCollection<Document>();
        public ObservableCollection <EntrantApplication> GetApplications(Entrant entrant)
        {
            EntrantApps.Clear();
            ObservableCollection <EntrantApplication> Applications = repositoryApplication.GetAll();

            foreach (EntrantApplication application in Applications)
            {
                if (application.Entrant == entrant)
                {
                    EntrantApps.Add(application);
                }
            }

            return(EntrantApps);
        }
Example #5
0
        //TODO Entrant заменить на другие функции и перегрузить под разные поисковые запросы
        //TODO В интерфейсах репозиториев можно дописывать новые функции
        //TODO Что передавать в Get для репозиториев
        public Entrant Get(Entrant entrant)
        {
#pragma warning disable CS0219 // Переменной "IsExisted" присвоено значение, но оно ни разу не использовано.
            bool IsExisted = false;
#pragma warning restore CS0219 // Переменной "IsExisted" присвоено значение, но оно ни разу не использовано.
            Entrant Entrant = new Entrant();
            int     ind     = db.Entrants.IndexOf(entrant);
            if (ind >= 0)
            {
                return(db.Entrants[ind]);
            }
            else
            {
                return(null);
            }
        }
Example #6
0
        public EntrantApplication Get(Entrant entrant)
        {
            bool IsExisted = false;
            EntrantApplication Application = new EntrantApplication();

            foreach (EntrantApplication application in db.Applications)
            {
                if (application.Entrant == entrant)
                {
                    IsExisted = true; Application = application;
                }
                ;
            }
            if (IsExisted)
            {
                return(Application);
            }
            else
            {
                return(null);
            }
        }
Example #7
0
        public void AddEntrant(Entrant entrant,
                               DateTime RegistrationDate,
                               bool NeedHostel,
                               string StatusApp,
                               CompetitiveGroup CompetitiveGroup,
                               SimpleClass ReturnDocumentsType,
                               FinSourceAndEduForms FinSourceAndEduForms,
                               ObservableCollection <Document> ApplicationDocuments,
                               ObservableCollection <EntranceTestResults> EntranceTestResults,
                               ObservableCollection <InstitutionAchievement> InstitutionAchievments,
                               bool Original,
                               ObservableCollection <EntrantApplication> applications)
        {
            bool isAcheived = false;

            foreach (EntrantApplication application in applications)
            {
                if ((application.Entrant.Person.PersonPassports[0].Series == entrant.Person.PersonPassports[0].Series) &&
                    (application.Entrant.Person.PersonPassports[0].Number == entrant.Person.PersonPassports[0].Number))
                {
                    isAcheived = true;
                }
            }
            if (isAcheived == true)
            {
                int ApplicationNumber  = applications.Count;
                EntrantApplication app = new EntrantApplication(
                    entrant, ApplicationNumber, RegistrationDate,
                    NeedHostel, StatusApp, CompetitiveGroup,
                    1, FinSourceAndEduForms,
                    ApplicationDocuments, EntranceTestResults,
                    InstitutionAchievments, Original);

                applications.Add(app);
            }
            else
            {
            }
        }
Example #8
0
 public void Update(Entrant Entrant)
 {
     db.Entrants[db.Entrants.IndexOf(Entrant)] = Entrant;
 }
Example #9
0
 public void Delete(Entrant Entrant)
 {
     db.Entrants.Remove(Entrant);
 }