init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
42
Kreta.EESZTInterface/Processors/TAJProcessor.cs
Normal file
42
Kreta.EESZTInterface/Processors/TAJProcessor.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Kreta.DataAccessManual.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.EESZTInterface.Processors
|
||||
{
|
||||
public class TAJProcessor
|
||||
{
|
||||
private readonly List<string> tajSzamok = new List<string>();
|
||||
|
||||
public void AddFileContent(byte[] bytes)
|
||||
{
|
||||
var tempTajSzamok = Encoding.ASCII.GetString(bytes).Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim("\",".ToCharArray())).ToList();
|
||||
if (tempTajSzamok[0].Contains("TAJ"))
|
||||
{
|
||||
tempTajSzamok.RemoveAt(0);
|
||||
}
|
||||
tajSzamok.AddRange(tempTajSzamok);
|
||||
}
|
||||
|
||||
public (int fertozott, int marNemFertozott) UpdateDB(IDalHandler h, int tanevId)
|
||||
{
|
||||
var tajszamokJson = JsonConvert.SerializeObject(tajSzamok.Distinct().ToArray());
|
||||
var felhasznaloDal = h.Felhasznalo();
|
||||
var ds = felhasznaloDal.UpdateFelhasznalokCovidAdatok(tanevId, tajszamokJson);
|
||||
|
||||
if ((ds.Tables.Count < 1)
|
||||
|| (ds.Tables[0].Rows.Count < 1))
|
||||
{
|
||||
return (-1, -1);
|
||||
}
|
||||
var fertozott = ds.Tables[0].Rows[0].Field<int>("Fertozott");
|
||||
var marNemFertozott = ds.Tables[0].Rows[0].Field<int>("MarNemFertozott");
|
||||
|
||||
return (fertozott, marNemFertozott);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue