using System.Collections.Generic; using System.Data; using System.Linq; using Kreta.BusinessLogic.Classes.AsposeHelpers; namespace Kreta.BusinessLogic.HelperClasses.MulasztasiErtesitokCOs { public class MulasztasiErtesitoCo { public MulasztasiErtesitoCo(DataSet ds, AsposeDocumentParameters parameters) { _mulasztasFejCoList = ds.Tables["MulasztasFej"].AsEnumerable().Select(row => new MulasztasFejCo(row)).ToList(); _mulasztasAdatCoList = ds.Tables["MulasztasAdat"].AsEnumerable().Select(row => new MulasztasAdatCo(row)).ToList(); _gondviseloAdatokCoList = ds.Tables["GondviseloAdatok"].AsEnumerable().Select(row => new GondviseloAdatokCo(row)).ToList(); TanuloMulasztasErtesitoDictionary = new Dictionary<(int, int), TanuloMulasztasErtesitoCo>(); foreach (var mulasztasFejCo in _mulasztasFejCoList) { TanuloMulasztasErtesitoDictionary.Add((mulasztasFejCo.TanuloId, mulasztasFejCo.TanuloCsoportId), new TanuloMulasztasErtesitoCo { MulasztasFej = mulasztasFejCo, MulasztasAdatList = _mulasztasAdatCoList.Where(x => x.TanuloId == mulasztasFejCo.TanuloId && x.TanuloCsoportId == mulasztasFejCo.TanuloCsoportId).ToList(), GondviseloAdatokList = _gondviseloAdatokCoList.Where(x => x.TanuloId == mulasztasFejCo.TanuloId && x.TanuloCsoportId == mulasztasFejCo.TanuloCsoportId).ToList(), }); } } private readonly List _mulasztasFejCoList; private readonly List _mulasztasAdatCoList; private readonly List _gondviseloAdatokCoList; public Dictionary<(int, int), TanuloMulasztasErtesitoCo> TanuloMulasztasErtesitoDictionary { get; set; } } }