getlogin.cs
来自「财务凭证管理系统,主要是从事公司或部门的财务方面的管理。此系统给会计人员带来很大」· CS 代码 · 共 65 行
CS
65 行
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 + =
减小字号Ctrl + -
显示快捷键?