b6498a7b1c
Feature: Sale analysis detail printing built
83 lines
2.5 KiB
C#
83 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
namespace Tanshu.Accounts.BI
|
|
{
|
|
public class ManagementBI
|
|
{
|
|
public decimal GetBalance(decimal? tax, DateTime startDate, DateTime endDate)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.ManagementDAO(startDate, endDate, connection))
|
|
{
|
|
return dao.GetBalance(tax);
|
|
}
|
|
}
|
|
}
|
|
public List<Guid> GetUpdateBillList(decimal tax, DateTime startDate, DateTime endDate)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.ManagementDAO(startDate, endDate, connection))
|
|
{
|
|
return dao.GetUpdateBillList(tax);
|
|
}
|
|
}
|
|
}
|
|
public decimal Update(Guid voucherID, decimal tax, DateTime startDate, DateTime endDate)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.ManagementDAO(startDate, endDate, connection))
|
|
{
|
|
return dao.Update(voucherID, tax);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void Reorder(DateTime startDate, DateTime endDate, ShowProgessDelegate showProgressDelegate)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.ManagementDAO(startDate, endDate, connection))
|
|
{
|
|
dao.Reorder(showProgressDelegate);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public bool MergeData(DateTime startDate, DateTime endDate, string sourceDB, string targetDB)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.ManagementDAO(startDate, endDate, connection))
|
|
{
|
|
return dao.MergeData(sourceDB, targetDB);
|
|
}
|
|
}
|
|
}
|
|
public List<PendingBillsBO> GetPaidBills(DateTime startDate, DateTime finishDate)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.ManagementDAO(startDate, finishDate, connection))
|
|
{
|
|
return dao.GetPaidBills();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|