init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
61
Kreta.Job.Tasks/IktatasJobBase.cs
Normal file
61
Kreta.Job.Tasks/IktatasJobBase.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Core;
|
||||
using Kreta.Core.Iktato.Poszeidon.Factory.Interface;
|
||||
using Kreta.Core.Iktato.Poszeidon.Infrastructure;
|
||||
using Kreta.Core.Iktato.Poszeidon.Infrastructure.Interface;
|
||||
using Kreta.DataAccessManual.Interfaces;
|
||||
using Kreta.Framework.Util;
|
||||
|
||||
namespace Kreta.Job.Tasks
|
||||
{
|
||||
public class IktatasJobBase
|
||||
{
|
||||
public IIktatoRepositoryFactory IktatoRepositoryFactory { get; }
|
||||
public IktatoServiceConfiguration IktatoServiceConfiguration { get; }
|
||||
|
||||
public IktatasJobBase(IIktatoRepositoryFactory iktatoRepositoryFactory, IWcfServiceContext wcfServiceContext, IktatoServiceConfiguration iktatoServiceConfiguration)
|
||||
{
|
||||
IktatoServiceConfiguration = iktatoServiceConfiguration;
|
||||
IktatoRepositoryFactory = iktatoRepositoryFactory;
|
||||
}
|
||||
|
||||
public IktatoRepositoryConfiguration GetIktatoRepositoryConfiguration(string intezmenyIktatoSzervezetAzonosito, string intezmenyPoszeidonBejelentkezesiNev)
|
||||
{
|
||||
return new IktatoRepositoryConfiguration()
|
||||
{
|
||||
EndpointAddress = string.Format(IktatoServiceConfiguration.EndpointAddress, "poszeidonai"),
|
||||
Password = IktatoServiceConfiguration.Password,
|
||||
Username = string.Format(IktatoServiceConfiguration.Username, intezmenyIktatoSzervezetAzonosito),
|
||||
PoszeidonAzonosito = intezmenyPoszeidonBejelentkezesiNev
|
||||
};
|
||||
}
|
||||
|
||||
protected List<(string, string)> GetDokumentumKulcsszavak(IDalHandler dalHandler, int iktatottDokumentumId, int intezmenyId, int tanevId, string tanevNeve, string iktatoNeve)
|
||||
{
|
||||
var iktDokTipus = dalHandler.IktatottDokumentumDal().Get(iktatottDokumentumId).DokumentumTipus;
|
||||
var kulcsszavak = new List<(string key, string value)>
|
||||
{
|
||||
(key: "Tanév", value: tanevNeve),
|
||||
(key: "Iktató személy", value: iktatoNeve),
|
||||
(key: "Dokumentum típus", value: iktDokTipus.GetItemNameFromCache(tanevId)),
|
||||
};
|
||||
|
||||
System.Data.DataSet ds = dalHandler.NyomtatvanyokDal().GetKulcsszoertekekOnIktatottDokumentum(intezmenyId, tanevId, iktatottDokumentumId);
|
||||
|
||||
foreach (System.Data.DataRow row in ds.Tables[0].Rows)
|
||||
{
|
||||
var ertek = row["ertek"].ToString();
|
||||
if (!string.IsNullOrWhiteSpace(ertek))
|
||||
{
|
||||
if (ertek.Length > Kreta.Core.Constants.MinMaxValues.MaxKulcsszoErtekLength)
|
||||
{
|
||||
ertek = ertek.Substring(0, Kreta.Core.Constants.MinMaxValues.MaxKulcsszoErtekLength - 3) + "...";
|
||||
}
|
||||
kulcsszavak.Add((key: row["tipus_DNAME"].ToString(), value: ertek));
|
||||
}
|
||||
}
|
||||
return kulcsszavak;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue