59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
using Soneta.Business;
|
|
using Soneta.SrodkiTrwale;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using static Soneta.SrodkiTrwale.SrodkiTrwaleModule;
|
|
|
|
namespace FX2_SP_VERIFIERS.AmortyzacjaWgCechy
|
|
{
|
|
internal class AmortyzacjaWgCechyVerifier : RowVerifier
|
|
{
|
|
public AmortyzacjaWgCechyVerifier(IRow row) : base(row)
|
|
{
|
|
}
|
|
|
|
public override string Description => null;
|
|
private new ObrotST Row => (ObrotST)base.Row;
|
|
|
|
protected override bool IsValid()
|
|
{
|
|
AmortyzacjaGenerujWorker a = new AmortyzacjaGenerujWorker();
|
|
a.Generuj();
|
|
|
|
try
|
|
{
|
|
|
|
bool isDofinansowanie = (bool)Row.SrodekTrwaly.Features["ST_Dofinansowania"];
|
|
using (ITransaction trans = Row.Session.Logout(true))
|
|
{
|
|
if (Row.Dokument.Definicja.Symbol == "AM-DF" && !isDofinansowanie)
|
|
Row.Delete();
|
|
else if (Row.Dokument.Definicja.Symbol == "AM-ŚT" && isDofinansowanie)
|
|
Row.Delete();
|
|
|
|
trans.CommitUI();
|
|
}
|
|
/*
|
|
using (ITransaction trans = Row.Session.Logout(true))
|
|
{
|
|
foreach (ObrotST obrST in Row.Pozycje)
|
|
{
|
|
if (Row.Definicja.Symbol == "AM-DF" && !(bool)obrST.SrodekTrwaly.Features["ST_Dofinansowania"])
|
|
obrST.Delete();
|
|
else if (Row.Definicja.Symbol == "AM-ŚT" && (bool)obrST.SrodekTrwaly.Features["ST_Dofinansowania"])
|
|
obrST.Delete();
|
|
}
|
|
trans.CommitUI();
|
|
}
|
|
*/
|
|
}
|
|
catch {}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|