CustomersApplicationService.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Threading.Tasks;
  3. using Abp.Application.Services.Dto;
  4. using Abp.Authorization;
  5. using Abp.Domain.Entities;
  6. using Abp.Domain.Repositories;
  7. using IwbZero.AppServiceBase;
  8. using ShwasherSys.Authorization.Permissions;
  9. using ShwasherSys.CustomerInfo.Dto;
  10. namespace ShwasherSys.CustomerInfo
  11. {
  12. [AbpAuthorize]
  13. public class CustomersAppService : ShwasherAsyncCrudAppService<Customer, CustomerDto, string, PagedRequestDto, CustomerCreateDto, CustomerUpdateDto >, ICustomersAppService
  14. {
  15. public CustomersAppService(IRepository<Customer, string> repository) : base(repository)
  16. {
  17. KeyIsAuto = false;
  18. }
  19. protected override string GetPermissionName { get; set; } = PermissionNames.PagesCustomerInfoCustomers;
  20. protected override string GetAllPermissionName { get; set; } = PermissionNames.PagesCustomerInfoCustomers;
  21. protected override string CreatePermissionName { get; set; } = PermissionNames.PagesCustomerInfoCustomersCreate;
  22. protected override string UpdatePermissionName { get; set; } = PermissionNames.PagesCustomerInfoCustomersUpdate;
  23. protected override string DeletePermissionName { get; set; } = PermissionNames.PagesCustomerInfoCustomersDelete;
  24. public override async Task Delete(EntityDto<string> input)
  25. {
  26. CheckDeletePermission();
  27. var entity = await GetEntityByIdAsync(input.Id);
  28. #region shwasher temp
  29. AddCommonPropertyValue("TimeLastMod", DateTime.Now, ref entity);
  30. AddCommonPropertyValue("UserIDLastMod", AbpSession.UserName, ref entity);
  31. AddCommonPropertyValue("IsLock", "Y", ref entity);
  32. #endregion
  33. await CurrentUnitOfWork.SaveChangesAsync();
  34. //return MapToEntityDto(entity);
  35. }
  36. }
  37. }