narsil/Tanshu.Accounts.BI/AdvanceBI.cs

59 lines
1.7 KiB
C#
Raw Normal View History

2010-03-02 17:56:21 +00:00
using System;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
2010-03-02 17:56:21 +00:00
namespace Tanshu.Accounts.BI
{
public class AdvanceBI : IAdvanceBI
{
public void Insert(AdvanceBO advance)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
2010-03-02 17:56:21 +00:00
{
using (var dao = new SqlDAO.AdvanceDAO(connection))
2010-03-02 17:56:21 +00:00
{
dao.Insert(advance);
}
}
}
2011-12-05 09:23:02 +00:00
public AdvanceBO Get(Guid advanceID)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
2011-12-05 09:23:02 +00:00
{
using (var dao = new SqlDAO.AdvanceDAO(connection))
2011-12-05 09:23:02 +00:00
{
return dao.Get(advanceID);
}
}
}
2010-03-02 17:56:21 +00:00
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())
2010-03-02 17:56:21 +00:00
{
using (var dao = new SqlDAO.AdvanceDAO(connection))
2010-03-02 17:56:21 +00:00
{
return dao.GetAdvances(fromDate, toDate, all);
}
}
}
public void Adjust(Guid advanceID, Guid userID)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
2010-03-02 17:56:21 +00:00
{
using (var dao = new SqlDAO.AdvanceDAO(connection))
2010-03-02 17:56:21 +00:00
{
dao.Adjust(advanceID, userID);
}
}
}
}
}