You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
4.0 KiB
159 lines
4.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using QMAPP.DAL;
|
|
using QMAPP.FJC.Entity.Message;
|
|
using QMFrameWork.Data;
|
|
|
|
namespace QMAPP.FJC.DAL.Message
|
|
{
|
|
public class MessageDAL : BaseDAL
|
|
{
|
|
|
|
/// <summary>
|
|
/// 获取待发送短信信息
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<OutBox> GetOutBoxList()
|
|
{
|
|
List<OutBox> list = new List<OutBox>();
|
|
|
|
string sql = "select * from OutBox ";
|
|
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
list = session.GetList<OutBox>(sql, new List<DataParameter>().ToArray()).ToList<OutBox>();
|
|
}
|
|
|
|
return list;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取发送失败短信信息
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<BadOutBox> GetBadOutBoxList()
|
|
{
|
|
|
|
List<BadOutBox> list = new List<BadOutBox>();
|
|
|
|
string sql = "select * from badoutbox ";
|
|
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
list = session.GetList<BadOutBox>(sql, new List<DataParameter>().ToArray()).ToList<BadOutBox>();
|
|
}
|
|
|
|
|
|
return list;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 插入发送成功短信信息
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
public void InsertSendOutBox(SendOutBox entity)
|
|
{
|
|
if (BaseSession != null)
|
|
{
|
|
BaseSession.Insert<SendOutBox>(entity);
|
|
}
|
|
else
|
|
{
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
session.Insert<SendOutBox>(entity);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 插入发送失败短信信息
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
public void InsertBadOutBox(BadOutBox entity)
|
|
{
|
|
|
|
if (BaseSession != null)
|
|
{
|
|
BaseSession.Insert<BadOutBox>(entity);
|
|
}
|
|
else
|
|
{
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
session.Insert<BadOutBox>(entity);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除待发送短信信息
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
public void DeleteBadOutBox(BadOutBox entity)
|
|
{
|
|
|
|
if (BaseSession != null)
|
|
{
|
|
BaseSession.Delete<BadOutBox>(entity);
|
|
|
|
}
|
|
else
|
|
{
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
session.Delete<BadOutBox>(entity);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 插入待发送短信信息
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
public void InsertOutBox(OutBox entity)
|
|
{
|
|
if (BaseSession != null)
|
|
{
|
|
|
|
BaseSession.Insert<OutBox>(entity);
|
|
}
|
|
else
|
|
{
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
session.Insert<OutBox>(entity);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除待发送短信信息
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
public void DeleteOutBox(OutBox entity)
|
|
{
|
|
if (BaseSession != null)
|
|
{
|
|
BaseSession.Delete<OutBox>(entity);
|
|
}
|
|
else
|
|
{
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
session.Delete<OutBox>(entity);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|