📄 sql.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;
using Web_Speaking.DataAccesslayer;
using Web_Speaking.Modelayer;
namespace Web_Speaking.Businesslayer
{
public class SQL
{
public void aa(ref DataList d_list)
{
string str_sql = "select L_name,contents,sdate from T_login,T_title where T_login.L_Id= T_title.L_id order by T_id desc";
SQLHelper sh = new SQLHelper();
d_list.DataSource = sh.DataSet(str_sql);
d_list.DataBind();
}
public DataSet GetOnlineMsg(Class_login Class_login)
{
SQLHelper cls_sqlHelper = new SQLHelper();
return cls_sqlHelper.DataSet("select * from T_login where L_name='" + Class_login.pub_user_name + "'");
}
public void updateOutLogin(Class_login Class_login)
{
SQLHelper cls_sqlHelper = new SQLHelper();
cls_sqlHelper.operatorConn("update T_login set online=0 where L_name='" + Class_login.pub_user_name + "'");
}
public string getOlineUserMsg()
{
string strMsg = "";
SQLHelper cls_sqlhelper = new SQLHelper();
DataSet ds = cls_sqlhelper.DataSet("select * from T_login where online=1");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
strMsg += ds.Tables[0].Rows[i]["L_name"].ToString() + ",";
}
return strMsg;
}
public void insertContext(Class_title Class_title)
{
string str_sql = "insert into T_title(contents, upfile, sdate, L_id) values('" + Class_title.pub_contents + "','" + Class_title.pub_upfile + "','" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "'," + Class_title.pub_L_id + ")";
SQLHelper cls_sqlhelper = new SQLHelper();
cls_sqlhelper.operatorConn(str_sql);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -