2010-03-02 17:56:21 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.BI
|
|
|
|
|
{
|
2013-11-28 10:39:33 +00:00
|
|
|
|
public class PaymentBI
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
|
|
|
|
public void Insert(PaymentBO payment)
|
|
|
|
|
{
|
2013-11-16 06:01:58 +00:00
|
|
|
|
|
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2013-11-16 06:01:58 +00:00
|
|
|
|
using (var dao = new SqlDAO.PaymentDAO(connection))
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
|
|
|
|
dao.Insert(payment);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public List<PaymentDisplayBO> GetPayments(Guid? userID, DateTime fromDate, DateTime toDate)
|
|
|
|
|
{
|
|
|
|
|
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));
|
2013-11-16 06:01:58 +00:00
|
|
|
|
|
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2013-11-16 06:01:58 +00:00
|
|
|
|
using (var dao = new SqlDAO.PaymentDAO(connection))
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
|
|
|
|
return dao.GetPayments(userID, fromDate, toDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public void Delete(Guid paymentID)
|
|
|
|
|
{
|
2013-11-16 06:01:58 +00:00
|
|
|
|
|
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2013-11-16 06:01:58 +00:00
|
|
|
|
using (var dao = new SqlDAO.PaymentDAO(connection))
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
|
|
|
|
dao.Delete(paymentID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|