narsil/Tanshu.Accounts.BI/SalesAnalysisBI.cs
2011-12-05 14:53:02 +05:30

60 lines
2.4 KiB
C#

using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;
using System.Data.SqlClient;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.DAOFactory;
using Tanshu.Data.DAO;
namespace Tanshu.Accounts.BI
{
public class SalesAnalysisBI : ISalesAnalysisBI
{
public List<SalesAnalysisDetailBO> GetSaleDetail(DateTime startDate, DateTime finishDate, Guid costCenterID)
{
var factory = GetFactory.GetDAOFactory(Database.GetFactoryType);
using (var connection = factory.Connection)
{
using (ISalesAnalysisDAO dao = factory.GetSalesAnalysisDAO(connection))
{
return dao.GetSaleDetail(startDate, finishDate, costCenterID);
}
}
}
public List<SalesAnalysisBO> GetSale(DateTime startDate, DateTime finishDate)
{
var factory = GetFactory.GetDAOFactory(Database.GetFactoryType);
using (var connection = factory.Connection)
{
using (ISalesAnalysisDAO dao = factory.GetSalesAnalysisDAO(connection))
{
return dao.GetSale(startDate, finishDate);
}
}
}
public void GetAdditionalInfo(ref decimal freeSale, ref decimal voids, ref decimal pending, ref decimal net, ref decimal tax, DateTime startDate, DateTime finishDate)
{
var factory = GetFactory.GetDAOFactory(Database.GetFactoryType);
using (var connection = factory.Connection)
{
using (ISalesAnalysisDAO dao = factory.GetSalesAnalysisDAO(connection))
{
dao.GetAdditionalInfo(ref freeSale, ref voids, ref pending, ref net, ref tax, startDate, finishDate);
}
}
}
public List<SalesAnalysisBO> GetSalesTaxReturn(DateTime startDate, DateTime finishDate, ref decimal freeSale, ref decimal voids, ref decimal pending, ref decimal net, ref decimal tax)
{
var factory = GetFactory.GetDAOFactory(Database.GetFactoryType);
using (var connection = factory.Connection)
{
using (ISalesAnalysisDAO dao = factory.GetSalesAnalysisDAO(connection))
{
return dao.GetSalesTaxReturn(startDate, finishDate, ref freeSale, ref voids, ref pending, ref net, ref tax);
}
}
}
}
}