示例#1
0
        /// <summary>
        /// Check test permission of current station by searching the serial number of pre-station status.
        /// </summary>
        /// <param name="SerialNumber"></param> serial number of trackpad.
        /// <param name="Model"></param> part number of trackpad.
        /// <param name="Station"></param> current station ID.
        /// <returns></returns> true: get permission; false: no permission.
        public bool SFCS_PermissonCheck(String SerialNumber, String Model, string WorkerID, String Station)
        {
            bool permisson = false;

            if (SerialNumber.Length < 15)
            {
                return(true);
            }
            string permisson_info = SFCSconnection.Check_Route(SerialNumber, Model, Station);

            //MessageBox.Show(permisson_info);
            if (permisson_info.Contains("Pass"))
            {
                permisson = true;
            }
            //switch (permisson_info)
            //{
            //    case 0:
            //        permisson = true;
            //        break;
            //    case 1:
            //        permisson = false;
            //        connect_error = "SFCS: " + SerialNumber.ToString() + " failed at SMT.";
            //        break;
            //    case 2:
            //        permisson = false;
            //        connect_error = "SFCS: " + SerialNumber.ToString() + " failed at AOI.";
            //        break;
            //    case 3:
            //        permisson = false;
            //        connect_error = "SFCS: " + SerialNumber.ToString() + " failed at TPT.";
            //        break;
            //    case 4:
            //        permisson = false;
            //        connect_error = "SFCS: " + SerialNumber.ToString() + " does not exsist.";
            //        break;
            //    case 9:
            //        permisson = false;
            //        connect_error = "SFCS: Cannot find SFCS database.";
            //        break;
            //    case 10:
            //        permisson = false;
            //        connect_error = "SFCS: SFCS connection time out.";
            //        break;
            //    case 11:
            //        permisson = false;
            //        connect_error = "SFCS: Failed to connect SFCS.";
            //        break;
            //    default:
            //        permisson = false;
            //        connect_error = "SFCS: Unkown error when trying to get permission.";
            //        break;
            //}
            return(permisson);
        }
示例#2
0
        /// <summary>
        /// Check test permission of current station by searching the serial number of pre-station status.
        /// </summary>
        /// <param name="SerialNumber"></param> serial number of BLE Device.
        /// <param name="Model"></param> part number of BLE Device.
        /// <param name="Station"></param> current station ID.
        /// <returns></returns> true: get permission; false: no permission.
        public override string PermissonCheck(string SerialNumber, string Model, string WorkerID, string Station)
        {
            if (Connect() != true)
            {
                return("FAIL: " + LastError);
            }

            if (!IsValidSerialNumber("PermissonCheck ", SerialNumber))
            {
                return("FAIL: Serialnumber : " + SerialNumber + " is invalid!!!");
            }


            string permisson_info = "No Directive GeneralLinkSql found.";

            if (!CyBLE_MTK_Application.Properties.Settings.Default.GeneralLinkSqlLocalDebug)
            {
                permisson_info = SFCSconnection.Check_Route(SerialNumber, Model, Station);
            }
            else
            {
                permisson_info = SFCSconnectionLocal.Check_Route(SerialNumber, Model, Station);
            }

            //MessageBox.Show(permisson_info);
            if (permisson_info.ToLower().Contains("pass"))
            {
                return(permisson_info);
            }
            else
            {
                LastError = "Permission denied.";
                return(permisson_info);
            }
            //switch (permisson_info)
            //{
            //    case 0:
            //        permisson = true;
            //        break;
            //    case 1:
            //        permisson = false;
            //        connect_error = "SFCS: " + SerialNumber.ToString() + " failed at SMT.";
            //        break;
            //    case 2:
            //        permisson = false;
            //        connect_error = "SFCS: " + SerialNumber.ToString() + " failed at AOI.";
            //        break;
            //    case 3:
            //        permisson = false;
            //        connect_error = "SFCS: " + SerialNumber.ToString() + " failed at TPT.";
            //        break;
            //    case 4:
            //        permisson = false;
            //        connect_error = "SFCS: " + SerialNumber.ToString() + " does not exsist.";
            //        break;
            //    case 9:
            //        permisson = false;
            //        connect_error = "SFCS: Cannot find SFCS database.";
            //        break;
            //    case 10:
            //        permisson = false;
            //        connect_error = "SFCS: SFCS connection time out.";
            //        break;
            //    case 11:
            //        permisson = false;
            //        connect_error = "SFCS: Failed to connect SFCS.";
            //        break;
            //    default:
            //        permisson = false;
            //        connect_error = "SFCS: Unkown error when trying to get permission.";
            //        break;
            //}
        }