init
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
// TODO ERTEKELES REFAKT2 ERTEKELESMOD: Ha töröljük a T_TANARIATLAGSULY táblát, akkor törölni kell az egész fájlt, a hozzá tartozó tárolt eljárásokat és minden referenciát!
|
||||
// https://jira.ekreta.hu/browse/KRETA2-12367
|
||||
using System;
|
||||
using System.Data;
|
||||
using Kreta.DataAccess.Interfaces;
|
||||
using Kreta.DataAccessManual.Interfaces;
|
||||
using Kreta.DataAccessManual.Util;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Util;
|
||||
using SDA.DataProvider;
|
||||
using SDA.Kreta.Entities;
|
||||
|
||||
namespace Kreta.DataAccessManual
|
||||
{
|
||||
internal class TanariAtlagSulyDal : DataAccessBase, ITanariAtlagSulyDal
|
||||
{
|
||||
public TanariAtlagSulyDal(DalHandler handler, GridParameters parameters) : base(handler, parameters) { }
|
||||
|
||||
public TanariAtlagSulyDal(DalHandler handler) : base(handler) { }
|
||||
|
||||
public ITanariAtlagSuly Get()
|
||||
{
|
||||
return TanariAtlagSuly.GiveAnInstance();
|
||||
}
|
||||
|
||||
public ITanariAtlagSuly Get(int id)
|
||||
{
|
||||
var entity = Get() as TanariAtlagSuly;
|
||||
entity.LoadByID(id);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void Insert(ITanariAtlagSuly dto)
|
||||
{
|
||||
var entity = dto as TanariAtlagSuly;
|
||||
entity.Insert(true);
|
||||
dto.ID = entity.ID;
|
||||
DalHelper.Commit();
|
||||
}
|
||||
|
||||
public void Update(ITanariAtlagSuly dto)
|
||||
{
|
||||
var entity = dto as TanariAtlagSuly;
|
||||
entity.FullUpdate();
|
||||
DalHelper.Commit();
|
||||
}
|
||||
|
||||
public int? GetIdByErtekelesModId(int tanevId, int ertekelesModId)
|
||||
{
|
||||
using (var sdaCommand = new SDACommand())
|
||||
{
|
||||
sdaCommand.Connection = UserContext.Instance.SDAConnection;
|
||||
sdaCommand.Transaction = UserContext.Instance.SDATransaction;
|
||||
sdaCommand.CommandType = CommandType.StoredProcedure;
|
||||
sdaCommand.CommandText = "uspGetSulyIdByErtekelesMod";
|
||||
|
||||
sdaCommand.Parameters.Add("pTanevId", SDADBType.Int).Value = tanevId;
|
||||
sdaCommand.Parameters.Add("pErtekelesModId", SDADBType.Int).Value = ertekelesModId;
|
||||
|
||||
int? result = null;
|
||||
object resultObject = sdaCommand.ExecuteScalar();
|
||||
|
||||
if (resultObject != null)
|
||||
{
|
||||
result = Convert.ToInt32(resultObject);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user