예제 #1
0
 public FormWCConfig(SQLiteDatabase sqlite)
 {
     InitializeComponent();
     dbsqlite = sqlite;
     loadconfig();
     //faz o load da base dados
     LoadQuestions();
 }
예제 #2
0
        public FormMain()
        {
            InitializeComponent();

            if (new Utils().dbExists())
            {
                sql = new SQLiteDatabase();
                fillCbYear();
            }
            comboBoxMonth.Enabled = false;
        }
예제 #3
0
 public FormEvaCoolDown(SQLiteDatabase sqlite)
 {
     InitializeComponent();
     loadconfig();
     //db
     dbsqlite = sqlite;
     //datetimepicker
     dateTimePickerStart.Value = DateTime.Now;
     dateTimePickerEnd.Value = DateTime.Now;
     //load questions
     DataTable reader = dbsqlite.GetDataTable("select cd.idquestions, qwc.questions, qwc.id, round((SUM(cd.rating) / count(qwc.id)),2) AS median from cooldown cd, questionwc qwc where cd.idquestions = qwc.id group by qwc.id");
     LoadPanel(reader);
 }
예제 #4
0
 public FormViewEvaluation(SQLiteDatabase db)
 {
     InitializeComponent();
     loadconfig();
     dbsqlite = db;
     //datetimepicker
     dateTimePickerStart.Value = DateTime.Now;
     dateTimePickerEnd.Value = DateTime.Now;
     labelEvaPhysical.Text = "--%";
     labelEvaMental.Text = "--%";
     labelEvaTechnical.Text = "--%";
     labelEvaPractive.Text = "--%";
 }
예제 #5
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     openFileDialogMoneyLoverFile.FileName = "";
     openFileDialogMoneyLoverFile.ShowDialog();
     if (!openFileDialogMoneyLoverFile.FileName.Equals(""))
     {
         //copiar a DB para a pasta do soft
         if (new Utils().dbExists())
         {
             sql = null;
             GC.Collect();
             GC.WaitForPendingFinalizers();
         }
         new Utils().copyFile(openFileDialogMoneyLoverFile.FileName);
         sql = new SQLiteDatabase();
     }
     fillCbYear();
 }
예제 #6
0
 public FormEvaluation(SQLiteDatabase db, String[] time)
 {
     InitializeComponent();
     loadconfig();
     dbsqlite = db;
     timesql = time;
     //physical
     if (time[0] != "")
     {
         String value = dbsqlite.ExecuteScalar("select CAST(questionsdone AS REAL) / questionstotal from warmup where subtype = 'physical' and datequestions = '" + time[0] + "'");
         Double evaphysical = new Utils().stringtoDouble(value) * 100;
         labelEvaPhysical.Text = evaphysical.ToString() + "%";
         if (evaphysical <= 50)
         {
             labelEvaPhysical.ForeColor = Color.Red;
         }
         else
         {
             if (evaphysical > 50 && evaphysical < 75)
             {
                 labelEvaPhysical.ForeColor = Color.Orange;
             }
             else
             {
                 labelEvaPhysical.ForeColor = Color.Green;
             }
         }
     }
     else
     {
         labelEvaPhysical.Text = "--%";
     }
     //mental
     if (time[1] != "")
     {
         String value = dbsqlite.ExecuteScalar("select CAST(questionsdone AS REAL) / questionstotal from warmup where subtype = 'mental' and datequestions = '" + time[1] + "'");
         Double evaphysical = new Utils().stringtoDouble(value) * 100;
         labelEvaMental.Text = evaphysical.ToString() + "%";
         if (evaphysical <= 50)
         {
             labelEvaMental.ForeColor = Color.Red;
         }
         else
         {
             if (evaphysical > 50 && evaphysical < 75)
             {
                 labelEvaMental.ForeColor = Color.Orange;
             }
             else
             {
                 labelEvaMental.ForeColor = Color.Green;
             }
         }
     }
     else
     {
         labelEvaMental.Text = "--%";
     }
     //technical
     if (time[2] != "")
     {
         String value = dbsqlite.ExecuteScalar("select CAST(questionsdone AS REAL) / questionstotal from warmup where subtype = 'technical' and datequestions = '" + time[2] + "'");
         Double evaphysical = new Utils().stringtoDouble(value) * 100;
         labelEvaTechnical.Text = evaphysical.ToString() + "%";
         if (evaphysical <= 50)
         {
             labelEvaTechnical.ForeColor = Color.Red;
         }
         else
         {
             if (evaphysical > 50 && evaphysical < 75)
             {
                 labelEvaTechnical.ForeColor = Color.Orange;
             }
             else
             {
                 labelEvaTechnical.ForeColor = Color.Green;
             }
         }
     }
     else
     {
         labelEvaTechnical.Text = "--%";
     }
     //practice
     if (time[3] != "")
     {
         String value = dbsqlite.ExecuteScalar("select CAST(questionsdone AS REAL) / questionstotal from warmup where subtype = 'practice' and datequestions = '" + time[3] + "'");
         Double evaphysical = new Utils().stringtoDouble(value) * 100;
         labelEvaPractive.Text = evaphysical.ToString() + "%";
         if (evaphysical <= 50)
         {
             labelEvaPractive.ForeColor = Color.Red;
         }
         else
         {
             if (evaphysical > 50 && evaphysical < 75)
             {
                 labelEvaPractive.ForeColor = Color.Orange;
             }
             else
             {
                 labelEvaPractive.ForeColor = Color.Green;
             }
         }
     }
     else
     {
         labelEvaPractive.Text = "--%";
     }
 }