public long Create(PrivacyIncident entity)
        {
            CommonHelper.ValidateArgumentNotNull(entity, nameof(entity));
            Helper.ValidateTodayIsAllowedUpdateDate(entity.IncidentYear, entity.IncidentMonth, InputAllowedInDays);

            // populate audit fields
            PopulateAuditFields(entity, null, creating: true);

            return(PrivacyIncidentService.Create(entity).Id);
        }
        public PrivacyIncident Update(long id, PrivacyIncident entity)
        {
            CommonHelper.ValidateArgumentNotNull(entity, nameof(entity));
            Helper.ValidateTodayIsAllowedUpdateDate(entity.IncidentYear, entity.IncidentMonth, InputAllowedInDays);

            var existing = PrivacyIncidentService.Get(id);

            if (!IsAdmin())
            {
                Helper.ValidateStatusIsDraft(existing.Status);
            }

            // populate audit fields
            PopulateAuditFields(entity, existing);

            entity.Id = id;
            return(PrivacyIncidentService.Update(entity));
        }
 public int GetLastTalliedNumber(int year, int month)
 {
     return(PrivacyIncidentService.GetLastTalliedNumber(year, month));
 }
 public SearchResult <PrivacyIncident> Search([FromUri] PrivacyIncidentSearchCriteria criteria)
 {
     criteria = criteria ?? new PrivacyIncidentSearchCriteria();
     return(PrivacyIncidentService.Search(criteria));
 }
 public PrivacyIncident Get(long id)
 {
     return(PrivacyIncidentService.Get(id));
 }