Ejemplo n.º 1
0
        public static bool CreateTable(string tableName)
        {
            bool issuc = true;

            try
            {
                //**判断数据库是否存在,以及数据库是否创建成功*/

                if (!AccessDBBase.ExistDB("reflowertester", "root", "pempenn", GlobalData.MySqlPort))
                {
                    if (!AccessDBBase.CreateDB("reflowertester", "root", "pempenn"))
                    {
                        LogClass.WriteLogFile("创建数据库失败->");
                    }
                    return(false);
                }

                //**建表*/
                if (!AccessDBBase.ExecuteCommand("reflowertester", "root", "pempenn", GlobalData.MySqlPort, SqlCmd_baseProfile_m(tableName)))//sqlCmd_baseProfile
                {
                    // LogClass.WriteLogFile("创建表baseprofile失败");
                    LogClass.WriteLogFile("创建表RTfile失败->" + tableName);
                    return(false);
                }
            }
            catch (MySqlException ex)
            {
                // LogClass.WriteLogFile(ex.Message);
                LogClass.WriteLogFile(ex.Message);
                return(false);
            }
            return(issuc);
        }
Ejemplo n.º 2
0
 public static bool DeleteData_baseProfile(string tableName, string line, string productName)
 {
     try
     {
         if (!AccessDBBase.ExecuteCommand("ReflowerTester", "root", "pempenn", GlobalData.MySqlPort, SqlCmd_deleteData_baseprofile2(tableName, line, productName)))
         {
             LogClass.WriteLogFile("Reflower Tester:清除时间段内数据失败2");
         }
     }
     catch (MySqlException ex)
     {
         LogClass.WriteLogFile("Reflower Tester:清除时间段内数据失败_2" + ex.Message);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 3
0
        public static bool InsertBaseProfile(string tableName, string Line, string ReflowerName, string ProductName, DateTime StartTime, DateTime EndTime, string TechnologyType, string TechnologyName, string ProcessName, string ReflowerTechName, string SolderName, string PtsFileName, string PtsFilePath, string ImgPath)
        {
            string startTime        = string.Format("{0:yyyy-MM-dd HH:mm:ss}", StartTime);
            string endTime          = string.Format("{0:yyyy-MM-dd HH:mm:ss}", EndTime);
            string getCommandInsert = string.Format(baseProfile_insertFormat(tableName), "'" + Line + "'", "'" + ReflowerName + "'", "'" + ProductName + "'", "'" + startTime + "'", "'" + endTime + "'", "'" + TechnologyType + "'", "'" + TechnologyName + "'", "'" + ProcessName + "'", "'" + ReflowerTechName + "'", "'" + SolderName + "'", "'" + PtsFileName + "'", "'" + PtsFilePath + "'", "'" + ImgPath + "'");

            try
            {
                if (AccessDBBase.ExecuteCommand("ReflowerTester", "root", "pempenn", GlobalData.MySqlPort, getCommandInsert))
                {
                    return(true);
                }
                else
                {
                    LogClass.WriteLogFile("Reflower Tester:baseProfile插入数据失败");
                    return(false);
                }
            }
            catch (MySqlException ex)
            {
                LogClass.WriteLogFile("Reflower Tester:baseProfile插入数据失败" + ex.Message);
                return(false);
            }
        }