using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CY.IDAL;
using CY.Model;
using AbstractFactory;
using CY.IBaseDAL;
using CY.Infrastructure.DESEncrypt;
using CY.Infrastructure.Query;
using CY.Infrastructure;
namespace CY.BLL
{
///
/// 充值记录的业务逻辑类
///
public class Pay_AccountedRecordBLL
{
IPay_AccountedRecordDAL _IPay_AccountedRecordDal = null;
///
/// 初始化构造
///
public Pay_AccountedRecordBLL()
{
//获取Pay_AccountedRecord DAL实现
_IPay_AccountedRecordDal = Factory.GetDALByInterfaceName(DALInterface.IPay_AccountedRecordDAL) as IPay_AccountedRecordDAL;
}
///
/// 新增充值记录
///
///
///
public bool InsertModel(CY.Model.Pay_AccountedRecord rType)
{
try
{
return _IPay_AccountedRecordDal.InserModel(rType);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// 修改充值记录
///
///
///
public bool UpdateModel(CY.Model.Pay_AccountedRecord rType)
{
try
{
return _IPay_AccountedRecordDal.UpdateModel(rType);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// 根据流水号获取充值记录
///
/// 流水号
///
public Pay_AccountedRecord GetModel(string RecordNumber)
{
Pay_AccountedRecord result = null;
try
{
result = _IPay_AccountedRecordDal.SelectModleByRecordNumber(RecordNumber) as Pay_AccountedRecord;//执行查询
}
catch (Exception ex)
{
throw ex;
}
return result;//返回结果
}
///
/// 生成新的流水号
///
///
public string GetNewRecordNumber()
{
string RecordNumber=DateTime.Now.ToString("MMdd")+DateTime.Now.Millisecond.ToString()+MathRandom.RandomNumber(6);
return RecordNumber;
}
///
/// 根据账户编号分页查询
///
///
///
///
public IEnumerable SelectModelPage(Infrastructure.Query.Pagination pagination, int? PayId)
{
try
{
return _IPay_AccountedRecordDal.SelectModelPage(pagination,PayId);
}
catch (Exception ex)
{
throw ex;
}
}
}
}