You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.4 KiB
73 lines
2.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using MESClassLibrary.BLL.Log;
|
|
using MESClassLibrary.Model;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using System.Reflection;
|
|
|
|
namespace MESClassLibrary.DAL.BasicInfo
|
|
{
|
|
public class OperatorDAL
|
|
{
|
|
public static string TableName = "tb_Operator";
|
|
|
|
/// <summary>
|
|
/// 根据操作员姓名和工位查询
|
|
/// </summary>
|
|
/// <param name="OperatorName"></param>
|
|
/// <returns></returns>
|
|
public DataTable SearchInfoByName(string OperatorName,string StationID)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"select * from " + TableName + " where OperatorName=@OperatorName and StationID=@StationID";
|
|
|
|
SqlParameter[] param = new SqlParameter[2];
|
|
param[0] = new SqlParameter("@OperatorName", SqlDbType.VarChar);
|
|
param[0].Value = OperatorName;
|
|
|
|
param[1] = new SqlParameter("@StationID", SqlDbType.VarChar);
|
|
param[1].Value = StationID;
|
|
|
|
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public DataTable SearchInfoByNameAndPsw(string OperatorName, string StationID,string OperatorPsw)
|
|
{
|
|
try
|
|
{
|
|
string sql = @"select * from " + TableName + " where OperatorName=@OperatorName and StationID=@StationID and OperatorPsw=@OperatorPsw";
|
|
|
|
SqlParameter[] param = new SqlParameter[3];
|
|
param[0] = new SqlParameter("@OperatorName", SqlDbType.VarChar);
|
|
param[0].Value = OperatorName;
|
|
|
|
|
|
param[1] = new SqlParameter("@StationID", SqlDbType.VarChar);
|
|
param[1].Value = StationID;
|
|
|
|
param[2] = new SqlParameter("@OperatorPsw", SqlDbType.VarChar);
|
|
param[2].Value = OperatorPsw;
|
|
|
|
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|