📄 logindaoimpl.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using DaFanRongMIS.Model.Common;
namespace DaFanRongMIS.Model.Login
{
class LoginDAOImpl:LoginDAO
{
public string Login(LoginEntity LE)
{
string str = null;
try
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = ConnectionDataBase.getConOpen();
cmd.CommandText = "select count(*) from Login,CashRegister where Login.UserID=@UserID and Login.Password=@Password and CashRegister.MAC=@MAC and Login.CashRegisterID=CashREgister.ID";
cmd.Parameters.Add("@UserID",LE.UserID);
cmd.Parameters.Add("@Password",LE.Password);
cmd.Parameters.Add("@MAC",LE.mAC);
int i = 0;
i = Convert.ToInt32(cmd.ExecuteScalar());
if (i > 0)
{
str = "OK";
}
else
{
cmd.CommandText = "select count(*) from Login where Login.UserID=@UserID and Login.Password=@Password";
int j = 0;
j = Convert.ToInt32(cmd.ExecuteScalar());
if (j > 0)
{
str = "Error";
}
}
}
catch (Exception e)
{
str = e.Message;
}
finally
{
ConnectionDataBase.getConClose();
}
return str;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -