init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
52
Kreta.DataAccessManual/KirTelephelyDAL.cs
Normal file
52
Kreta.DataAccessManual/KirTelephelyDAL.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
using System.Data;
|
||||
using Kreta.DataAccess.Interfaces;
|
||||
using Kreta.DataAccessManual.Interfaces;
|
||||
using Kreta.DataAccessManual.Util;
|
||||
using Kreta.Framework;
|
||||
using SDA.DataProvider;
|
||||
using SDA.Kreta.Entities;
|
||||
|
||||
namespace Kreta.DataAccessManual
|
||||
{
|
||||
internal class KirTelephelyDAL : DataAccessBase, IKirTelephelyDal
|
||||
{
|
||||
public KirTelephelyDAL(DalHandler dalHandler) : base(dalHandler)
|
||||
{ }
|
||||
|
||||
public string GetKretaKodByTelephelyId(int telephelyId, int tanevId)
|
||||
{
|
||||
using (var command = new SDACommand())
|
||||
{
|
||||
command.Connection = UserContext.Instance.SDAConnection;
|
||||
command.Transaction = UserContext.Instance.SDATransaction;
|
||||
command.CommandType = CommandType.Text;
|
||||
command.Parameters.Add(nameof(telephelyId), telephelyId);
|
||||
command.Parameters.Add(nameof(tanevId), tanevId);
|
||||
|
||||
command.CommandText = $@"
|
||||
SELECT KirTelephely.C_KRETAKOD
|
||||
FROM T_KIRTELEPHELY_OSSZES KirTelephely
|
||||
where KirTelephely.TOROLT = 'F'
|
||||
and KirTelephely.C_KOD = @{nameof(telephelyId)}
|
||||
and KirTelephely.C_TANEVID = @{nameof(tanevId)}";
|
||||
|
||||
return command.ExecuteScalar()?.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public void Insert(IKirTelephely dto)
|
||||
{
|
||||
var entity = dto as KirTelephely;
|
||||
entity.Insert(true);
|
||||
|
||||
dto.ID = entity.ID;
|
||||
|
||||
DalHelper.Commit();
|
||||
}
|
||||
|
||||
public IKirTelephely Get()
|
||||
{
|
||||
return KirTelephely.GiveAnInstance();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue