public FormWCConfig(SQLiteDatabase sqlite) { InitializeComponent(); dbsqlite = sqlite; loadconfig(); //faz o load da base dados LoadQuestions(); }
public FormMain() { InitializeComponent(); if (new Utils().dbExists()) { sql = new SQLiteDatabase(); fillCbYear(); } comboBoxMonth.Enabled = false; }
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); }
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 = "--%"; }
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(); }
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 = "--%"; } }