Пример #1
0
        void AddOrphanDocument()
        {
            var newDoc = new OrphanDocument();

            if (DialogLayer.ShowEditor(EditingContent.OrphanDocumentEditor,
                                       new OrphanDocumentEditorViewModel(newDoc)))
            {
                _claim.OrphanDocuments.Add(newDoc);
                RaisePropertyChanged("OrphanDocuments");
            }
        }
Пример #2
0
        public JsonResult GetOrphanDocuments()
        {
            string conStr = Session["conStr"].ToString(); //ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString;
            int    id     = Convert.ToInt32(Session["CURENT_USER_ID"]);
            DocumenteScanateRepository dsr = new DocumenteScanateRepository(id, conStr);

            DocumentScanat[]      docs = (DocumentScanat[])dsr.GetOrphanDocuments().Result;
            List <OrphanDocument> ofs  = new List <OrphanDocument>();

            foreach (DocumentScanat ds in docs)
            {
                OrphanDocument od = new OrphanDocument();
                od.DOCUMENT_SCANAT = ds; od.SELECTED = true;
                ofs.Add(od);
            }
            return(Json(ofs, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        /// <summary>
        /// Отправляет заявление в архив и создает на его основе новое с такми же данными, но с опущенными номером
        /// заявления, условиями приёма, внутренними вступительными испытаниями.
        /// Также выставляет текущую дату регистрации заявления.
        /// </summary>
        /// <param name="existingClaim">Существующее заявление, отправляемое в архив</param>
        void CopyAndArchiveClaim()
        {
            var existingClaim = SelectedClaim;
            // Копируем текущие данные в новое заявление
            var newClaim = new Claim
            {
                RegistrationDate  = DateTime.Now,
                ClaimStatus       = existingClaim.ClaimStatus,
                IsHostelNeed      = existingClaim.IsHostelNeed,
                PersonalReturning = existingClaim.PersonalReturning
            };

            newClaim.ClaimStatus = existingClaim.ClaimStatus;

            // Документы о результатах ЕГЭ
            foreach (var egeDoc in existingClaim.EgeDocuments)
            {
                var newEgeDoc = new EgeDocument
                {
                    OriginalReceivedDate = egeDoc.OriginalReceivedDate,
                    Number = egeDoc.Number,
                    Date   = egeDoc.Date,
                    Year   = egeDoc.Year
                };

                // Сами результаты ЕГЭ
                foreach (var result in egeDoc.EgeResults)
                {
                    var newResult = new EgeResult
                    {
                        ExamSubject = result.ExamSubject,
                        Value       = result.Value,
                        IsChecked   = result.IsChecked
                    };

                    newEgeDoc.EgeResults.Add(newResult);
                }
                newClaim.EgeDocuments.Add(newEgeDoc);
            }

            // Индивидуальные достижения
            foreach (var individualAchievement in existingClaim.EntranceIndividualAchievements)
            {
                var newIndAch = new EntranceIndividualAchievement
                {
                    CampaignIndividualAchievement = individualAchievement.CampaignIndividualAchievement
                };
                newClaim.EntranceIndividualAchievements.Add(newIndAch);
            }

            // Документы об образовании
            // Аттестаты среднего образования
            foreach (var eduDoc in existingClaim.SchoolCertificateDocuments)
            {
                var newEduDoc = new SchoolCertificateDocument
                {
                    OriginalReceivedDate = eduDoc.OriginalReceivedDate,
                    Series                = eduDoc.Series,
                    Number                = eduDoc.Number,
                    Date                  = eduDoc.Date,
                    SubdivisionCode       = eduDoc.SubdivisionCode,
                    EducationOrganization = eduDoc.EducationOrganization,
                    FiveCount             = eduDoc.FiveCount,
                    FourCount             = eduDoc.FourCount,
                    ThreeCount            = eduDoc.ThreeCount
                };
                newClaim.SchoolCertificateDocuments.Add(newEduDoc);
            }

            // Дипломы СПО
            foreach (var eduDoc in existingClaim.MiddleEducationDiplomaDocuments)
            {
                var newEduDoc = new MiddleEducationDiplomaDocument
                {
                    OriginalReceivedDate = eduDoc.OriginalReceivedDate,
                    Series                = eduDoc.Series,
                    Number                = eduDoc.Number,
                    Date                  = eduDoc.Date,
                    SubdivisionCode       = eduDoc.SubdivisionCode,
                    EducationOrganization = eduDoc.EducationOrganization,
                    FiveCount             = eduDoc.FiveCount,
                    FourCount             = eduDoc.FourCount,
                    ThreeCount            = eduDoc.ThreeCount
                };
                newClaim.MiddleEducationDiplomaDocuments.Add(newEduDoc);
            }

            // Дипломы ВО
            foreach (var eduDoc in existingClaim.HighEducationDiplomaDocuments)
            {
                var newEduDoc = new HighEducationDiplomaDocument
                {
                    OriginalReceivedDate = eduDoc.OriginalReceivedDate,
                    Series                = eduDoc.Series,
                    Number                = eduDoc.Number,
                    Date                  = eduDoc.Date,
                    SubdivisionCode       = eduDoc.SubdivisionCode,
                    EducationOrganization = eduDoc.EducationOrganization,
                    FiveCount             = eduDoc.FiveCount,
                    FourCount             = eduDoc.FourCount,
                    ThreeCount            = eduDoc.ThreeCount
                };
                newClaim.HighEducationDiplomaDocuments.Add(newEduDoc);
            }

            // Документы
            // Документы, подтверждающие льготу
            foreach (var quotaDoc in existingClaim.OrphanDocuments)
            {
                var newQuotaDoc = new OrphanDocument
                {
                    OriginalReceivedDate = quotaDoc.OriginalReceivedDate,
                    OrphanDocumentType   = quotaDoc.OrphanDocumentType,
                    Series       = quotaDoc.Series,
                    Number       = quotaDoc.Number,
                    Date         = quotaDoc.Date,
                    Organization = quotaDoc.Organization
                };
                newClaim.OrphanDocuments.Add(newQuotaDoc);
            }

            // Другие истребуемые документы
            var oldOtherRequiredDoc = existingClaim.OtherRequiredDocuments.First();
            var newOtherRequiredDoc = new OtherRequiredDocument
            {
                Certificate        = oldOtherRequiredDoc.Certificate,
                Photos             = oldOtherRequiredDoc.Photos,
                MedicinePermission = oldOtherRequiredDoc.MedicinePermission,
                Fluorography       = oldOtherRequiredDoc.Fluorography
            };

            newClaim.OtherRequiredDocuments.Add(newOtherRequiredDoc);

            // Личные данные абитуриента
            var oldEntrant = existingClaim.Entrants.First();
            var newEntrant = new Entrant
            {
                LastName          = oldEntrant.LastName,
                FirstName         = oldEntrant.FirstName,
                Patronymic        = oldEntrant.Patronymic,
                Gender            = oldEntrant.Gender,
                CustomInformation = oldEntrant.CustomInformation,
                Email             = oldEntrant.Email,
                Address           = oldEntrant.Address,
                Phone             = oldEntrant.Phone,
                MobilePhone       = oldEntrant.MobilePhone,
                FatherName        = oldEntrant.FatherName,
                FatherPhone       = oldEntrant.FatherPhone,
                FatherJob         = oldEntrant.FatherJob,
                MotherName        = oldEntrant.MotherName,
                MotherPhone       = oldEntrant.MotherPhone,
                MotherJob         = oldEntrant.MotherJob,
                JobPost           = oldEntrant.JobPost,
                JobOrganization   = oldEntrant.JobOrganization,
                JobStage          = oldEntrant.JobStage,
                ForeignLanguage   = oldEntrant.ForeignLanguage
            };

            newClaim.Entrants.Add(newEntrant);

            // Документ, удостоверяющий личность
            foreach (var identityDoc in existingClaim.IdentityDocuments)
            {
                var newIdentityDoc = new IdentityDocument
                {
                    OriginalReceivedDate = identityDoc.OriginalReceivedDate,
                    Series               = identityDoc.Series,
                    Number               = identityDoc.Number,
                    Date                 = identityDoc.Date,
                    SubdivisionCode      = identityDoc.SubdivisionCode,
                    Organization         = identityDoc.Organization,
                    Citizenship          = identityDoc.Citizenship,
                    IdentityDocumentType = identityDoc.IdentityDocumentType,
                    BirthDate            = identityDoc.BirthDate,
                    BirthPlace           = identityDoc.BirthPlace
                };
                newClaim.IdentityDocuments.Add(newIdentityDoc);
            }

            Session.DataModel.Claims.Add(newClaim);

            // Открываем редактор нового заявления
            var vm        = new ClaimEditorViewModel(newClaim);
            var validator = new ClaimValidator(newClaim);

            if (DialogLayer.ShowEditor(EditingContent.ClaimEditor, vm, validator))
            {
                Session.DataModel.SaveChanges();

                // Производим возврат текущего заявления
                SendClaimToArchive();

                // Обновляем список заявлений
                Session.RefreshAll();
                RaisePropertyChanged("ClaimList");
            }
        }
Пример #4
0
 public OrphanDocumentEditorViewModel(OrphanDocument document)
 {
     _doc = document;
 }