|
#region DotNet Namespaces
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion
#region Custom Namespaces
using BEs.Person;
using BEs.Enums;
#region Namespaces from the EHS Framework
using EHS.CommonDataHelpers.Interfaces;
using EHS.DatabaseHelpers.SqlDatabaseHelper.DataHelpers;
using EHS.CommonDataHelpers.DataHelper.Data;
using EHS.CommonDataHelpers.DataHelper.DataHelpers;
#endregion
#endregion
namespace DLSql.PersonDAL
{
public class PersonDAL : IDataAccessLayer<Person, People>
{
#region Implemented Methods
public TransactionStatus Insert(Person dataObject)
{
StoredProcedure<Person> objSpInsert = new StoredProcedure<Person>();
objSpInsert.ProcedureName = "SpPerson_Insert";
objSpInsert.DataObject = dataObject;
objSpInsert.SqlConnectionInfo.ConnectionType = (int)ConnectionType.NormalLogin;
return objSpInsert.ExecuteNonQuery();
}
public TransactionStatus Update(Person dataObject)
{
throw new NotImplementedException();
}
public TransactionStatus Delete(Person dataObject)
{
throw new NotImplementedException();
}
public TransactionStatusWithData<People> GetAll()
{
People objPeople = new People();
StoredProcedure<People> SpPerson_GetAll = new StoredProcedure<People>();
SpPerson_GetAll.ProcedureName = "SpPerson_GetAll";
SpPerson_GetAll.DataObject = objPeople;
SpPerson_GetAll.SqlConnectionInfo.ConnectionType = (int)ConnectionType.NormalLogin;
return SpPerson_GetAll.ExecuteReader();
}
public TransactionStatusWithData<Person> GetById(Person dataObject)
{
StoredProcedure<Person> Sp_PersonGetById = new StoredProcedure<Person>();
Sp_PersonGetById.ProcedureName = "Sp_PersonGetById";
Sp_PersonGetById.DataObject = dataObject;
Sp_PersonGetById.SqlConnectionInfo.ConnectionType = (int)ConnectionType.NormalLogin;
return Sp_PersonGetById.ExecuteReader();
}
#endregion
#region GetById
public Person GetById(PersonGetByIdParams personGetByIdParams)
{
Person objPerson = new Person();
StoredProcedure<Person> Sp_PersonGetById = new StoredProcedure<Person>();
Sp_PersonGetById.ProcedureName = "Sp_PersonGetById";
Sp_PersonGetById.DataObject = objPerson;
Sp_PersonGetById.ConditionData = personGetByIdParams;
Sp_PersonGetById.SqlConnectionInfo.ConnectionType = (int)ConnectionType.NormalLogin;
Sp_PersonGetById.ExecuteReader();
return objPerson;
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.