예제 #1
0
        public async Task <OperationDetails> Delete(SubmissionDoc dto)
        {
            var found = await _submissionRepository.GetAsync(p => p.Id == dto.Id);

            if (found == null)
            {
                return(new OperationDetails(false, "Абітурієнт не знайдений", ""));
            }

            _submissionRepository.Delete(dto);
            await SaveSubmission();

            return(new OperationDetails(true, "Документ абітурієнта видалений", ""));
        }
예제 #2
0
        public async Task <OperationDetails> Create(SubmissionDoc dto)
        {
            var found = await _submissionRepository.GetAsync(p => p.FullName == dto.FullName);

            if (found != null)
            {
                return(new OperationDetails(false, "Такий абітурієнт вже є у базі", ""));
            }

            _submissionRepository.Add(dto);
            await SaveSubmission();

            return(new OperationDetails(true, "Документ абітурієнта створений", ""));
        }
예제 #3
0
        public bool SubmitModule(SubmissionCandidate candidate, string contactName, string contactEmail, List<string> feedback)
        {
            var submission = new SubmissionDoc
            {
                SubmissionSource = "Website",
                Contact = new Contact
                {
                    Name = contactName,
                    Email = contactEmail
                },
                Candidate = candidate
            };

            _storage.Store(submission);

            return true;
        }
예제 #4
0
 public async Task <OperationDetails> Edit(SubmissionDoc dto)
 {
     throw new NotImplementedException();
 }