Пример #1
0
        public Proposition Approve(Proposition proposition)
        {
            Proposition CurrentProposition = _propositionService.GetById(proposition.Id);

            CurrentProposition.Approval.Add(proposition.Approval.Last());

            if (CurrentProposition.Approval.Count() >= 2)
            {
                CurrentProposition.State = "Approved";
                _propositionService.Update(CurrentProposition);
            }

            _approvalService.Save(proposition.Approval.Last());

            return(CurrentProposition);
        }
Пример #2
0
        public Proposition Reject(Proposition proposition)
        {
            Proposition CurrentProposition = _propositionService.GetById(proposition.Id);

            CurrentProposition.Approval.Add(proposition.Approval.Last());
            CurrentProposition.State = "Rejected";
            _propositionService.Update(CurrentProposition);

            _approvalService.Save(proposition.Approval.Last());
            return(CurrentProposition);
        }
Пример #3
0
 public PropositionDTO Update(PropositionDTO entity)
 => _propositionConverter.ConvertEntityToDTO(_service.Update(_propositionConverter.ConvertDTOToEntity(entity)));