/// <summary> /// This method is responisble for querying the Database based on the /// date picked by the user. /// </summary> private void LoadShopOnDate() { DateTime selectedDate = this.ShopDatePicker.Value; try { this.ShopStats = business_ShopTableAdapter1.GetDataByDateInShop(selectedDate.Date.ToString()); CalculateStats(); } catch (Exception ex) { MessageBox.Show("Error in shop history: " + ex.Message); } }
private void LoadToday() { try { todaysDateLabel.Text = DateTime.Today.Date.ToShortDateString(); _dovetail_dbDataSet.Business_ShopDataTable shopTable = business_ShopTableAdapter1.GetDataByDateInShop(DateTime.Today.Date.ToString()); TodayShopStats = shopTable.NewBusiness_ShopRow(); if (shopTable.Count > 0) { foreach (_dovetail_dbDataSet.Business_ShopRow row in shopTable) { TodayShopStats = row; } SetStats(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }