?? user.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>
/// user 的摘要說明
/// 管理員 用戶
/// </summary>
public class user
{
public user()
{
//
// TODO: 在此處添加構(gòu)造函數(shù)邏輯
//
}
string user_id;
string name;
string password;
string M_email;
public string email
{
get
{
return M_email;
}
set
{
M_email=value;
}
}
DataAccess.CDataAccess ExEUsers = new DataAccess.CDataAccess();
public bool Add(string user_id, string xm, string pwd, string emaill)
{
string sqistr = "insert into Users (uses_id,name,password,email)values ('" + user_id + " ','" + xm + "','" + pwd + "','" + emaill + "')";
DataAccess.CDataAccess DA = new DataAccess.CDataAccess();
if (DA.ExecuteQuery(sqistr))
{
return true;
}
else
{
return false;
}
}
public DataTable showtab()
{
string sqlstr = "select* from Users ";
return ExEUsers.GetDataTable(sqlstr);
}
public bool xiugai()
{
string sqistr = "update dbo.Users SET name='585',password='456789',email='kop'where cust_id='01'";
if (ExEUsers.ExecuteQuery(sqistr))
{
return true;
}
else
{
return false;
}
}
public Boolean delete(string cust_id)
{
string sqistr = "delete [Users] where [uses_id]='" + cust_id + "'";
if (ExEUsers.ExecuteQuery(sqistr))
{
return true;
}
else
{
return false;
}
}
public bool Select(string xm, string pwd)
{
string srtSql = "select * from users where name='" + xm + "' and password='" + pwd + "'";
if (ExEUsers.ExecuteQueryA(srtSql) != 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 請告訴我 你 需要驗證的 值
/// 驗證文本框里的值是否為空,為空就告訴前面(以 真假的 形式 )
/// </summary>
/// <param name="txt"></param>
/// <returns></returns>
public bool chenked(string txt)
{
if (txt.Length == 0)
{
return false;
}
else
{
return true;
}
}
public DataTable SelectTable(string user_id)
{
string sqlstr = "select* from users where user_id='" + user_id + "'";
return ExEUsers.GetDataTable(sqlstr);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -