Example #1
0
        /// <summary>
        /// 查詢帳號
        /// </summary>
        /// <param name="UserID">工號</param>
        /// <param name="Psw">密碼</param>
        private DataTable QueryEmp(string UserID, string Psw, string DBName)
        {
            IO_DB     IO     = new IO_DB();
            F_Check   ck     = new F_Check();
            DataSet   ds     = new DataSet();
            DataTable dt     = new DataTable();
            long      lonPsw = ck.PasswdValue(Psw);
            string    SqlCom = @"Select S_empd_id,N_empd_name,S_empd_autgid 
                               From dbo.employee_data 
                               Where S_empd_id=@S_empd_id 
                               And L_empd_psword=@L_empd_psword";

            Hashtable hs = new Hashtable();

            hs.Add("@S_empd_id", UserID);
            hs.Add("@L_empd_psword", lonPsw);

            ds = IO.SqlQuery(DBName, SqlCom, hs);
            dt = ds.Tables[0];
            return(dt);
        }