コード例 #1
0
        public async Task <bool> AddItemAsync(HolidayEntry data)
        {
            if (!await DataProvider.AddAsync(data))
            {
                return(false);
            }
            await Auditing.AddAuditAsync($"{nameof(HolidayEntryDataProvider)}.{nameof(AddItemAsync)}", Dataset, Guid.Empty,
                                         $"Add Holiday Entry {data.Id}",
                                         DataBefore : null,
                                         DataAfter : data
                                         );

            return(true);
        }
コード例 #2
0
        public async Task <bool> RemoveItemByIdentityAsync(int id)
        {
            HolidayEntry origData = Auditing.Active ? await GetItemByIdentityAsync(id) : null;

            if (!await DataProvider.RemoveByIdentityAsync(id))
            {
                return(false);
            }

            await Auditing.AddAuditAsync($"{nameof(HolidayEntryDataProvider)}.{nameof(RemoveItemByIdentityAsync)}", Dataset, Guid.Empty,
                                         $"Remove Holiday Entry {id}",
                                         DataBefore : origData,
                                         DataAfter : null
                                         );

            return(true);
        }
コード例 #3
0
        public async Task <UpdateStatusEnum> UpdateItemAsync(HolidayEntry data)
        {
            HolidayEntry origData = Auditing.Active ? await GetItemByIdentityAsync(data.Id) : null;

            UpdateStatusEnum status = await DataProvider.UpdateByIdentityAsync(data.Id, data);

            if (status != UpdateStatusEnum.OK)
            {
                return(status);
            }

            await Auditing.AddAuditAsync($"{nameof(HolidayEntryDataProvider)}.{nameof(UpdateItemAsync)}", Dataset, Guid.Empty,
                                         $"Update Holiday Entry {data.Id}",
                                         DataBefore : origData,
                                         DataAfter : data
                                         );

            return(UpdateStatusEnum.OK);
        }