Пример #1
0
 private void GenerateData()
 {
     File.Delete(txtSqliteData.Text);
     File.Create(txtSqliteData.Text).Close();
     GenerateScriptHelper.SaveSqliteDb(ScriptSqliteHelper.TableAssessment, txtSqliteData.Text);
     GenerateScriptHelper.SaveSqliteDb(ScriptSqliteHelper.TableAssessmentSectionQuestion, txtSqliteData.Text);
 }
Пример #2
0
 private void RunSectionQuestion()
 {
     chkSectionQuestion.BackColor = SystemColors.MenuHighlight;
     using (var mysqlProvider = new MySqlDataProvider(_connectionString))
     {
         string    script, strScriptSqlite;
         DataTable table;
         var       total = mysqlProvider.GetCount(ScriptMySqlHelper.TableSectionQuestionCount);
         _skip = 0;
         if (total > Take)
         {
             while (_skip < total)
             {
                 script = string.Format(ScriptMySqlHelper.TableSectionQuestion, _skip, Take);
                 table  = mysqlProvider.GetDataTable(script);
                 GenerateScriptHelper.SaveSqliteDb(ScriptSqliteHelper.TableSectionQuestion, txtSaveSQLiteFile.Text);
                 strScriptSqlite = ScriptSqliteHelper.InsertSectionQuestionSchedule + table.GetScript(ScriptSqliteHelper.InsertSectionQuestionValue, 24);
                 GenerateScriptHelper.SaveSqliteDb(strScriptSqlite, txtSaveSQLiteFile.Text);
                 _skip += Take;
             }
         }
         else
         {
             script = string.Format(ScriptMySqlHelper.TableSectionQuestion, _skip, total);
             table  = mysqlProvider.GetDataTable(script);
             GenerateScriptHelper.SaveSqliteDb(ScriptSqliteHelper.TableSectionQuestion, txtSaveSQLiteFile.Text);
             strScriptSqlite = ScriptSqliteHelper.InsertSectionQuestionSchedule + table.GetScript(ScriptSqliteHelper.InsertSectionQuestionValue, 24);
             GenerateScriptHelper.SaveSqliteDb(strScriptSqlite, txtSaveSQLiteFile.Text);
         }
     }
     chkSectionQuestion.BackColor = SystemColors.Control;
 }