📄 message.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// MessageBox 的摘要说明
/// </summary>
public class Message:SqlDataBase
{
public Message()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
/// <summary>
/// 获取用户未读短信条数
/// </summary>
/// <param name="strUid">短信ID</param>
/// <returns></returns>
public string GetMessageCount(string strUid)
{
return RunSqlReturn("select count(id) from messagebox where sjrid="+strUid +" and isread=1 and show =1");
}
/// <summary>
/// 显示收件箱信息
/// </summary>
/// <param name="strUid">用户ID</param>
/// <returns></returns>
public DataView DvMessage(string strUid)
{
return GetDv("select * from v_messagebox where sjrid=" + strUid + " and show=1");
}
/// <summary>
/// 获取短信息内容
/// </summary>
/// <param name="strUid">短信ID</param>
/// <returns></returns>
public DataView DvMessageBox(string strUid)
{
RunSql("update messagebox set isread =0 where id=" + strUid);
return GetDv("select * from v_messagebox where id=" + strUid);
}
/// <summary>
/// 添加短信表
/// </summary>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
/// <param name="fjrid">发件人ID</param>
/// <param name="sjrid">收件人ID</param>
/// <returns></returns>
public bool AddMessage(string title, string content, string fjrid, string sjrid)
{
string strSql = "insert into messagebox(title,content,fjrid,sjrid)values('" + title + "','" + content + "','" + fjrid + "','" + sjrid + "')";
try
{
RunSql(strSql);
return true;
}
catch { return false; }
}
/// <summary>
/// 删除短信息
/// </summary>
/// <param name="strUid">段信息ID</param>
/// <returns></returns>
public bool DelMessage(string strUid)
{
string strSql = "update messagebox set show =0 where id="+strUid;
try
{
RunSql(strSql);
return true;
}
catch { return false; }
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -