narsil/Tanshu.Accounts.BI/AdvanceBI.cs

58 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.BI
{
public class AdvanceBI
{
public void Insert(AdvanceBO advance)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.AdvanceDAO(connection))
{
dao.Insert(advance);
}
}
}
public AdvanceBO Get(Guid advanceID)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.AdvanceDAO(connection))
{
return dao.Get(advanceID);
}
}
}
public List<AdvanceDisplayBO> GetAdvances(DateTime fromDate, DateTime toDate, bool all)
{
fromDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 00:00:00", fromDate));
toDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 23:59:59", toDate));
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.AdvanceDAO(connection))
{
return dao.GetAdvances(fromDate, toDate, all);
}
}
}
public void Adjust(Guid advanceID, Guid userID)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.AdvanceDAO(connection))
{
dao.Adjust(advanceID, userID);
}
}
}
}
}