You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PkGuidBusiness.cs 1.1KB

123456789101112131415161718192021222324252627282930313233
  1. using Luticate2.Utils.Business;
  2. using Luticate2.Utils.Dbo;
  3. using Luticate2.Utils.Dbo.Result;
  4. using Test.Utils.DataAccess;
  5. using Test.Utils.Dbo.PkGuid;
  6. namespace WebTest.Business
  7. {
  8. public class PkGuidBusiness : LuCrudBusiness<LuUtilsPkGuidDataAccess, PkGuidAddDbo, PkGuidDbo, PkGuidAddDbo>
  9. {
  10. public PkGuidBusiness(LuUtilsPkGuidDataAccess dataAccess) : base(dataAccess)
  11. {
  12. }
  13. protected override LuResult<PkGuidAddDbo> CheckAdd(PkGuidAddDbo obj)
  14. {
  15. if (obj.SomeText.EndsWith("_edited"))
  16. {
  17. return LuResult<PkGuidAddDbo>.Error(LuStatus.InputError, "someText can not end with '_edited'", "");
  18. }
  19. return LuResult<PkGuidAddDbo>.Ok(obj);
  20. }
  21. protected override LuResult<PkGuidAddDbo> CheckEdit(PkGuidDbo dbo, PkGuidAddDbo update)
  22. {
  23. if (!update.SomeText.EndsWith("_edited"))
  24. {
  25. return LuResult<PkGuidAddDbo>.Error(LuStatus.InputError, "someText must end with '_edited'", "");
  26. }
  27. return LuResult<PkGuidAddDbo>.Ok(update);
  28. }
  29. }
  30. }