using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DataLinkMesWork;


//using SystemFramework;

namespace bizFacade
{
    public partial class BaseDataSystemMES
    {
        /// <summary>
        /// 获得用户名和密码，验证登录信息。
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="dt"></param>
        /// <returns></returns>
        //public static bool GetUserName(string userName,string password,out DataTable dt)
        //{
        //    //string errorMessage;
        //    string sql;
        //    sql = "SELECT top 1  * FROM [MES_操作者_用户] "
        //        + "where  操作者工号='" + userName + "'"
        //        + "  and  密码='" + password + "'"  ;
        //    return DataAccess.ExecuteDataTable_OleDb_Access(sql, out  dt);
        //    //SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
        //}
        /// <summary>
        /// 更改用户密码
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        //public static bool UpdateUserName(string userName, string password)
        //{
        //    //string errorMessage;
        //    string sql;
        //    sql = "UPDATE  [MES_操作者_用户] "
        //        + "SET 密码='" + password+"'"
        //        + "where  操作者工号='" + userName + "'";
        //    return DataAccess.ExecuteSQL_OleDb_Access(sql);
        //    //return SQLCommon.ExecuteNonQuery_OleDb(sql, ApplicationConfig.ConnectionString_Access, out errorMessage);
        //}

        /// <summary>
        /// MES_操作者_登录
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="operatorCode">操作者工号</param>
        /// <param name="operatorName">操作者姓名</param>
        /// <param name="operatorShift">班次代码</param>
        /// <param name="LogType">登录退出 (=1登录) (=0退出)</param>
        /// <returns></returns>
        //public static bool InsertLoginAndLogoutUserName(string opName, string operatorCode, 
        //    string operatorName,int operatorShift, int LogType)
        //{
        //    //string errorMessage;
        //    string sql;
        //    sql = "INSERT INTO  [MES_操作者_用户] ([工位号], [操作者工号], [操作者姓名], [班次代码], [登录退出])"
        //        + "VALUES("
        //        + "'" + opName + "',"
        //        + "'" + operatorCode + "',"
        //        + "'" + operatorName + "',"
        //        + operatorShift.ToString() + ","
        //        + LogType.ToString()
        //        + ")";
        //    return DataAccess.ExecuteSQL_OleDb_Access(sql);

        //   //     return SQLCommon.ExecuteNonQuery_OleDb(sql, ApplicationConfig.ConnectionString_Access, out errorMessage);
        //}
    }
}
