void PoorClicked(object sender, EventArgs e) { ProductiveData p_Data = new ProductiveData { DateHour = DateTime.Now.Hour, DateDay = DateTime.Now.Day, DateMonth = DateTime.Now.Month, ProdutivityLevel = 2 }; AppDelegate.db.Insert(p_Data); DisbleButtons(); }
void RemoveLastPointClicked(object sender, EventArgs e) { var lastData = new ProductiveData(); //find last data point foreach (var dataPoint in AppDelegate.db.Table <ProductiveData>()) { lastData = dataPoint; } AppDelegate.db.Delete <ProductiveData>(lastData.DataNum); //database is empty if (AppDelegate.db.Table <ProductiveData>().Count() == 0) { DisableButton(b_Clear); DisableButton(b_RemoveLastDataPoint); } }