init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
99
Kreta.DataAccessManual/FoglalkozasAmiTanuloDal.cs
Normal file
99
Kreta.DataAccessManual/FoglalkozasAmiTanuloDal.cs
Normal file
|
@ -0,0 +1,99 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using Kreta.DataAccess.Interfaces;
|
||||
using Kreta.DataAccessManual.Interfaces;
|
||||
using Kreta.DataAccessManual.Util;
|
||||
using Kreta.Framework.Util;
|
||||
using SDA.Kreta.Entities;
|
||||
|
||||
namespace Kreta.DataAccessManual
|
||||
{
|
||||
internal class FoglalkozasAmiTanuloDal : DataAccessBase, IFoglalkozasAmiTanuloDal
|
||||
{
|
||||
public FoglalkozasAmiTanuloDal(DalHandler handler, GridParameters parameters)
|
||||
: base(handler, parameters)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public FoglalkozasAmiTanuloDal(DalHandler handler) : base(handler)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IFoglalkozasAmiTanulo Get()
|
||||
{
|
||||
return FoglalkozasAmiTanulo.GiveAnInstance();
|
||||
}
|
||||
|
||||
public IFoglalkozasAmiTanulo Get(int id)
|
||||
{
|
||||
var entity = FoglalkozasAmiTanulo.GiveAnInstance();
|
||||
entity.LoadByID(id);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void FullUpdate(IFoglalkozasAmiTanulo dto)
|
||||
{
|
||||
var entity = dto as FoglalkozasAmiTanulo;
|
||||
entity.FullUpdate(true);
|
||||
DalHelper.Commit();
|
||||
}
|
||||
|
||||
public void Update(IFoglalkozasAmiTanulo dto)
|
||||
{
|
||||
var entity = dto as FoglalkozasAmiTanulo;
|
||||
entity.FullUpdate();
|
||||
DalHelper.Commit();
|
||||
}
|
||||
|
||||
public void Insert(IFoglalkozasAmiTanulo dto)
|
||||
{
|
||||
var entity = dto as FoglalkozasAmiTanulo;
|
||||
entity.Insert(true);
|
||||
|
||||
dto.ID = entity.ID;
|
||||
DalHelper.Commit();
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
{
|
||||
var entity = FoglalkozasAmiTanulo.GiveAnInstance();
|
||||
entity.LoadByID(id);
|
||||
|
||||
Delete(entity);
|
||||
}
|
||||
|
||||
public void Delete(IFoglalkozasAmiTanulo dto)
|
||||
{
|
||||
var entity = dto as FoglalkozasAmiTanulo;
|
||||
entity.Delete();
|
||||
|
||||
DalHelper.Commit();
|
||||
}
|
||||
|
||||
public IEnumerable<(int foglalkozasAmiTanuloId, int foglalkozasId)> GetFoglalkozasIdsListByTanuloAndOsztalyCsoportId(int tanuloId, int osztalyCsoportId)
|
||||
{
|
||||
var commandText = $@"
|
||||
SELECT
|
||||
fat.ID AS FoglalkozasAmiTanuloId
|
||||
,f.ID AS FoglalkozasId
|
||||
FROM T_FOGLALKOZASAMITANULO_OSSZES fat
|
||||
INNER JOIN T_FOGLALKOZAS_OSSZES f ON fat.C_FOGLALKOZASID = f.ID AND f.TOROLT = 'F'
|
||||
WHERE fat.TOROLT = 'F'
|
||||
AND fat.C_TANULOID = @{nameof(tanuloId)}
|
||||
AND f.C_OSZTALYCSOPORTID = @{nameof(osztalyCsoportId)}
|
||||
";
|
||||
|
||||
var parameters = new List<CommandParameter>
|
||||
{
|
||||
new CommandParameter(nameof(tanuloId), tanuloId),
|
||||
new CommandParameter(nameof(osztalyCsoportId), osztalyCsoportId)
|
||||
};
|
||||
|
||||
var ds = GetData(commandText, parameters);
|
||||
var result = ds.Tables[0].AsEnumerable().Select(r => (foglalkozasAmiTanuloId: r.Field<int>("FoglalkozasAmiTanuloId"), foglalkozasId: r.Field<int>("FoglalkozasId")));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue