1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using Luticate2.Utils.Business;
- using Luticate2.Utils.Dbo.Result;
- using Test.Utils.DataAccess;
- using Test.Utils.Dbo.PkGuid;
-
- namespace WebTest.Business
- {
- public class PkGuidBusiness : LuCrudBusiness<LuUtilsPkGuidDataAccess, PkGuidAddDbo, PkGuidDbo, PkGuidAddDbo, string>
- {
-
- public PkGuidBusiness(LuUtilsPkGuidDataAccess dataAccess, LuNotificationsBusiness notificationsBusiness) : base(dataAccess, notificationsBusiness)
- {
- EntityType = "pkguid";
- }
-
- protected override LuResult<PkGuidAddDbo> CheckAdd(PkGuidAddDbo obj)
- {
- if (obj.SomeText.EndsWith("_edited"))
- {
- return LuResult<PkGuidAddDbo>.Error(LuStatus.InputError, "someText can not end with '_edited'", "");
- }
- return LuResult<PkGuidAddDbo>.Ok(obj);
- }
-
- protected override LuResult<PkGuidAddDbo> CheckEdit(PkGuidDbo dbo, PkGuidAddDbo update)
- {
- if (!update.SomeText.EndsWith("_edited"))
- {
- return LuResult<PkGuidAddDbo>.Error(LuStatus.InputError, "someText must end with '_edited'", "");
- }
- return LuResult<PkGuidAddDbo>.Ok(update);
- }
- }
- }
|