コード例 #1
0
        public long Create(OperationalIncident entity)
        {
            CommonHelper.ValidateArgumentNotNull(entity, nameof(entity));
            Helper.ValidateTodayIsAllowedUpdateDate(entity.IncidentYear, entity.IncidentMonth, InputAllowedInDays);

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

            return(OperationalIncidentService.Create(entity).Id);
        }
コード例 #2
0
        public OperationalIncident Update(long id, OperationalIncident entity)
        {
            CommonHelper.ValidateArgumentNotNull(entity, nameof(entity));
            Helper.ValidateTodayIsAllowedUpdateDate(entity.IncidentYear, entity.IncidentMonth, InputAllowedInDays);

            var existing = OperationalIncidentService.Get(id);

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

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

            entity.Id = id;
            return(OperationalIncidentService.Update(entity));
        }
コード例 #3
0
 public int GetLastTalliedNumber(int year, int month)
 {
     return(OperationalIncidentService.GetLastTalliedNumber(year, month));
 }
コード例 #4
0
 public SearchResult <OperationalIncident> Search([FromUri] OperationalIncidentSearchCriteria criteria)
 {
     criteria = criteria ?? new OperationalIncidentSearchCriteria();
     return(OperationalIncidentService.Search(criteria));
 }
コード例 #5
0
 public OperationalIncident Get(long id)
 {
     return(OperationalIncidentService.Get(id));
 }