init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
86
Kreta.DataAccessManual/SzirStatFileDAL.cs
Normal file
86
Kreta.DataAccessManual/SzirStatFileDAL.cs
Normal file
|
@ -0,0 +1,86 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
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 SzirStatFileDAL : DataAccessBase, ISzirStatFileDAL
|
||||
{
|
||||
public SzirStatFileDAL(DalHandler handler) : base(handler) { }
|
||||
public SzirStatFileDAL(DalHandler handler, GridParameters parameters) : base(handler, parameters) { }
|
||||
|
||||
public ISzirStatFile Get()
|
||||
{
|
||||
return SzirStatFile.GiveAnInstance();
|
||||
}
|
||||
|
||||
public ISzirStatFile Get(int id)
|
||||
{
|
||||
var entity = SzirStatFile.GiveAnInstance();
|
||||
entity.LoadByID(id);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public List<int> GetSzirStatFileIdByTipusIdAndFeladatellatasiHelyId(int intezmenyId, int tanevId, int szirStatTipusId, int kirSzirFeladatellatasiHelyId)
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
var commandParameterList = new List<CommandParameter>
|
||||
{
|
||||
new CommandParameter(nameof(intezmenyId), intezmenyId),
|
||||
new CommandParameter(nameof(tanevId), tanevId),
|
||||
new CommandParameter(nameof(szirStatTipusId), szirStatTipusId),
|
||||
};
|
||||
|
||||
if (kirSzirFeladatellatasiHelyId > 0)
|
||||
{
|
||||
commandParameterList.Add(new CommandParameter(nameof(kirSzirFeladatellatasiHelyId), kirSzirFeladatellatasiHelyId));
|
||||
}
|
||||
string commandText = $@"
|
||||
SELECT
|
||||
ID
|
||||
FROM
|
||||
T_SZIRSTATFILE_OSSZES
|
||||
WHERE
|
||||
TOROLT = 'F'
|
||||
AND C_SZIRSTATTIPUSID = @{nameof(szirStatTipusId)}" +
|
||||
(kirSzirFeladatellatasiHelyId > 0 ? $@" AND C_KIRSZIRFELADATELLATASIHELYID = @{nameof(kirSzirFeladatellatasiHelyId)}" : "") + $@"
|
||||
AND C_INTEZMENYID = @{nameof(intezmenyId)}
|
||||
AND C_TANEVID = @{nameof(tanevId)}
|
||||
ORDER BY LASTCHANGED DESC";
|
||||
|
||||
DataSet dataSet = GetData(commandText, commandParameterList);
|
||||
if (dataSet != null && dataSet.Tables.Count > 0)
|
||||
{
|
||||
result = dataSet.Tables[0].AsEnumerable().Select(r => r.Field<int>("ID")).ToList();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public int Insert(ISzirStatFile dto)
|
||||
{
|
||||
var entity = dto as SzirStatFile;
|
||||
|
||||
entity.Insert();
|
||||
dto.ID = entity.ID;
|
||||
DalHelper.Commit();
|
||||
|
||||
return dto.ID;
|
||||
}
|
||||
|
||||
public void Delete(int id, int userId)
|
||||
{
|
||||
var entity = Get(id) as SzirStatFile;
|
||||
|
||||
entity.Torolt = true;
|
||||
|
||||
entity.FullUpdate();
|
||||
DalHelper.Commit();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue