/// <summary>
 /// 读取所有用户信息
 /// </summary>
 /// <returns></returns>
 public DataTable GetAllUserList()
 {
     DataTable dt = new cls_DAL().GetTable_MF_OSA_System_UserList("", ref Error);
     if (dt == null)
     {
         throw new Exception(Error);
     }
     else
     {
         return dt;
     }
 }
 /// <summary>
 /// 获取Spec表中的所有Temperature
 /// </summary>
 /// <returns></returns>
 public ArrayList GetDisitnctTemperatureInSpecTable()
 {
     DataTable dt = new cls_DAL().GetView("view_DisitnctTemperatureInSpecTable", "", ref Error);
     if (dt == null)
     {
         throw new Exception(Error);
     }
     else
     {
         ArrayList ret = new ArrayList();
         foreach (DataRow dr in dt.Rows)
         {
             ret.Add(dr[0].ToString());
         }
         return ret;
     }
 }
 /// <summary>
 /// 验证用户名及密码
 /// </summary>
 /// <param name="WorkID"></param>
 /// <param name="Password"></param>
 /// <param name="Error"></param>
 /// <returns></returns>
 public bool ValidatePasswordByUID(string UID, string Password, ref string Error)
 {
     DataTable dt = new cls_DAL().GetTable_MF_OSA_System_UserList(string.Format(" WHERE UID = '{0}'", UID), ref Error);
     if (dt == null || dt.Rows.Count != 1)
     {
         return false;
     }
     else
     {
         DataRow drUserInfo = dt.Rows[0];
         if (cls_PublicMethods.MD5(Password) == drUserInfo["Password"].ToString())
         {
             //SetUserInfoToGlobalVariables(drUserInfo);
             return true;
         }
         else
         {
             return false;
         }
     }
 }
 /// <summary>
 /// 验证用户名及密码
 /// </summary>
 /// <param name="WorkID"></param>
 /// <param name="Password"></param>
 /// <param name="Error"></param>
 /// <returns></returns>
 public bool ValidatePasswordByWorkID(string WorkID, string Password, ref string Error)
 {
     DataTable dt = new cls_DAL().GetTable_MF_OSA_System_UserList(string.Format(" WHERE `Work ID` = '{0}'", WorkID), ref Error);
     if (dt == null || dt.Rows.Count != 1)
     {
         Error = cls_PublicMethods.MessageCollectionReader("Error0027");
         return false;
     }
     else
     {
         DataRow drUserInfo = dt.Rows[0];
         if (cls_PublicMethods.MD5(Password) == drUserInfo["Password"].ToString())
         {
             //SetUserInfoToGlobalVariables(drUserInfo);
             return true;
         }
         else
         {
             Error = cls_PublicMethods.MessageCollectionReader("Error0028");
             return false;
         }
     }
 }
        /// <summary>
        /// 获取料号
        /// </summary>
        /// <returns></returns>
        public List<string> GetDistinctProductNoInSpecTable()
        {
            DataTable dt = new cls_DAL().GetView("view_distinctpninspectable", "", ref Error);
            if (dt == null)
            {
                throw new Exception(Error);
            }
            else
            {
                List<string> ret = new List<string>();
                ret.Add("全部");

                foreach (DataRow dr in dt.Rows)
                {
                    ret.Add(dr[0].ToString());
                }
                return ret;
            }
        }