using Soneta.Business; using Soneta.Core; using Soneta.Kasa; using Soneta.Ksiega; using System.Linq; namespace FX2_SP_VERIFIERS.SposobPlatnosciWeryfikator { internal class SposobPlatnosciDokVerifier : RowVerifier { public SposobPlatnosciDokVerifier(IRow row) : base(row) { } public override string Description => null; private new Platnosc Row => (Platnosc)base.Row; protected override bool IsValid() { try { if (GlobalConfig.IsActiveInDatabase(Row.Session)) { DokEwidencji dokh = Row.Ewidencja; if (dokh is not null && dokh.Definicja.Features["SposobPlatnosci"] is not null && dokh.Definicja.Features["Ewidencja ŚP"] is not null) { using (ITransaction trans = Row.Session.Logout(true)) { Row.SposobZaplaty = (SposobZaplaty)dokh.Definicja.Features["SposobPlatnosci"]; Row.EwidencjaSP = (EwidencjaSP)dokh.Definicja.Features["Ewidencja ŚP"]; trans.CommitUI(); } } } } catch { } return true; } } }