📄 getlogin.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using property.model.SystemInfo;
using property.model.GetConnection;//引用类名空间
namespace property.control.LogInfo
{
class GetLogin
{
/// <summary>
/// 些类功能方是登陆信息的验证
/// public string loginDen(admInfo adm)方法
/// </summary>
SqlCommand com = null;
SqlConnection con = null;
admInfo adm = new admInfo();
GetConnection getcon = new GetConnection();
#region //登陆
public string loginDen(admInfo adm)
{
string P_str_result = null;
try {
con = getcon.GetCon();
if (con.State == ConnectionState.Open)
{
com = new SqlCommand();
string select = "select count(*) from tb_adminfo where admName='" + adm.getadmName() + "' and admPassword='" + adm.getadmPassword() + "'";
com.CommandText = select;
com.Connection = con;
int P_int_Select = (int)com.ExecuteScalar();
// int t = com.ExecuteNonQuery();
com.Connection.Close();
con.Close();
if (P_int_Select == 1)
{
P_str_result = "adminOK";
}
else
{
P_str_result = "adminNO";
}//end block else if
}// end block
if(con==null)
{
P_str_result = "ConClose";
}
return P_str_result;
}
catch(Exception e) {
// result = "Error";
return e.ToString();
}//end block
}// end block
#endregion
}// end block class
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -