示例#1
0
文件: SFCS.cs 项目: Seapol/CyRepo
        public override bool UploadTestResult(string SerialNumber, string Model, string TesterID, UInt16 errorcode, string SocketId, string TestResult, string TestStation, string MFI_ID
                                              )
        {
            SqlConnection Con;
            string        adoCon;
            string        adoConEncrypted;
            string        sql;
            string        site;
            int           IntErrorCdoe = errorcode;

            SocketId = SocketId + "Socket#";

            if (!IsValidSerialNumber("UploadTestResult " + GetType().ToString(), SerialNumber))
            {
                return(false);
            }

            try
            {
#if SAVE_AdoCon_In_AppSettings
                site = ConfigurationManager.AppSettings["Site"];
                //MessageBox.Show(site);
                adoConEncrypted = ConfigurationManager.AppSettings["AdoCon"]
#else
                site            = CyBLE_MTK_Application.Properties.Settings.Default.Site;
                adoConEncrypted = CyBLE_MTK_Application.Properties.Settings.Default.AdoCon;
#endif
                                  adoCon = StrOperator.Decrypt(adoConEncrypted);
                //MessageBox.Show(adoCon);
                Con = new SqlConnection(adoCon);
                Con.Open();

                sql = "INSERT INTO if_check(if_site,if_barcode,if_result,if_mfi_id) VALUES (@Site,@BarCode,@Result,@MFiID)";

                SqlCommand sqlCmd = new SqlCommand(sql, Con);
                sqlCmd.Parameters.AddWithValue("@Site", site);
                sqlCmd.Parameters.AddWithValue("@BarCode", SerialNumber);
                sqlCmd.Parameters.AddWithValue("@Result", IntErrorCdoe);
                sqlCmd.Parameters.AddWithValue("@MFiID", MFI_ID);
                sqlCmd.ExecuteNonQuery();
                Con.Close();
                return(true);
            }
            catch (Exception ex)
            {
                LastError = "Failed to connect log server. (" + ex.Message + ")";
                MessageBox.Show(LastError, "Shopfloor error");
            }

            return(false);
        }
示例#2
0
        public override bool UploadTestResult(string SerialNumber, string Model, string TesterID, UInt16 errorcode, string SocketId, string TestResult, string TestStation, string MFI_ID
                                              )
        {
            SqlConnection Con;
            string        adoCon;
            string        adoConEncrypted;
            string        sql;
            string        site;
            int           IntErrorCdoe = errorcode;

            SocketId = SocketId + "Socket#";

            if (!IsValidSerialNumber("UploadTestResult " + GetType().ToString(), SerialNumber))
            {
                return(false);
            }

            try
            {
#if SAVE_AdoCon_In_AppSettings
                site = ConfigurationManager.AppSettings["Site"];
                //MessageBox.Show(site);
                adoConEncrypted = ConfigurationManager.AppSettings["AdoCon"]
#else
                site            = "S001";
                adoConEncrypted = "XCccYIbhUcfqizsAH7bqrHopZ+IaovwKtbxlTfklxB4iMYecEhGm2VNCfWi7DsUCrdxMtywF8VeqL94ePV0zaI5s6ejT5AIiqqR+twYHh2OAs88TiYPrvbk0np6ohVPX0jKo2oCM0t6/DCMb1wOPWw==";
#endif
                                  adoCon = StrOperator.Decrypt(adoConEncrypted);
                //MessageBox.Show(adoCon);
                Con = new SqlConnection(adoCon);
                Con.Open();

                sql = "INSERT INTO if_check(if_site,if_barcode,if_result,if_mfi_id) VALUES (@Site,@BarCode,@Result,@MFiID)";

                SqlCommand sqlCmd = new SqlCommand(sql, Con);
                sqlCmd.Parameters.AddWithValue("@Site", site);
                sqlCmd.Parameters.AddWithValue("@BarCode", SerialNumber);
                sqlCmd.Parameters.AddWithValue("@Result", IntErrorCdoe);
                sqlCmd.Parameters.AddWithValue("@MFiID", MFI_ID);
                sqlCmd.ExecuteNonQuery();
                Con.Close();
                return(true);
            }
            catch (Exception ex)
            {
                LastError = "Failed to connect log server. (" + ex.Message + ")";
            }

            return(false);
        }
示例#3
0
文件: SFCS.cs 项目: Seapol/CyRepo
        public override bool Connect()
        {
            SqlConnection Con;
            string        adoCon;
            string        adoConEncrypted;
            string        sql;
            string        site;


            try
            {
#if SAVE_AdoCon_In_AppSettings
                site = ConfigurationManager.AppSettings["Site"];
                //MessageBox.Show(site);
                adoConEncrypted = ConfigurationManager.AppSettings["AdoCon"]
#else
                site            = CyBLE_MTK_Application.Properties.Settings.Default.Site;
                adoConEncrypted = CyBLE_MTK_Application.Properties.Settings.Default.AdoCon;
#endif
                                  adoCon = StrOperator.Decrypt(adoConEncrypted);
                //MessageBox.Show(adoCon);
                Con = new SqlConnection(adoCon);
                Con.Open();



                Con.Close();
                SqlConnected = true;
            }
            catch (Exception ex)
            {
                SqlConnected = false;
                LastError    = "Failed to connect log server. (" + ex.Message + ")";
                MessageBox.Show(LastError, "Shopfloor error");
            }

            return(SqlConnected);
        }
示例#4
0
        public override bool Connect()
        {
            SqlConnection Con;
            string        adoCon;
            string        adoConEncrypted;
            string        sql;
            string        site;


            try
            {
#if SAVE_AdoCon_In_AppSettings
                site = ConfigurationManager.AppSettings["Site"];
                //MessageBox.Show(site);
                adoConEncrypted = ConfigurationManager.AppSettings["AdoCon"]
#else
                site            = "S001";
                adoConEncrypted = "XCccYIbhUcfqizsAH7bqrHopZ+IaovwKtbxlTfklxB4iMYecEhGm2VNCfWi7DsUCrdxMtywF8VeqL94ePV0zaI5s6ejT5AIiqqR+twYHh2OAs88TiYPrvbk0np6ohVPX0jKo2oCM0t6/DCMb1wOPWw==";
#endif
                                  adoCon = StrOperator.Decrypt(adoConEncrypted);
                //MessageBox.Show(adoCon);
                Con = new SqlConnection(adoCon);
                Con.Open();



                Con.Close();
                SqlConnected = true;
            }
            catch (Exception ex)
            {
                SqlConnected = false;
                LastError    = "Failed to connect log server. (" + ex.Message + ")";
            }

            return(SqlConnected);
        }