public Dashboard() { InitializeComponent(); InData consumo = new InData(); DataContext = new InDataViewModel(consumo); total.Text = InsureInfo.total().ToString(); updates.Text = Notification.GetCount().ToString(); }
private void Details_Click(object sender, RoutedEventArgs e) { if (this.listView.SelectedIndex == -1) { System.Windows.Forms.MessageBox.Show("Select an item first."); return; } int index = this.listView.SelectedIndex; InsureInfo current = all[index]; string detail = string.Format("Insurance ID= {0}, Provider={1}, Expire Date={2}, Total worth={3}, Associated Item={4}", current.ID, current.Provider, current.ExpireDate, current.TotalWorth, "50"); infoDialog ii = new infoDialog("Details", detail); ii.ShowDialog(); }
private void ButtonDelete_Click(object sender, RoutedEventArgs e) { if (this.listView.SelectedIndex == -1) { System.Windows.Forms.MessageBox.Show("Select an item first."); return; } int index = this.listView.SelectedIndex; int intid = all[index].ID; MessageBoxResult dialogResult = System.Windows.MessageBox.Show("Are you sure?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo); if (dialogResult == MessageBoxResult.Yes) { InsureInfo.Delete(intid); load_All(); } }
private void Button_Click(object sender, RoutedEventArgs e) { int idint; int.TryParse(id.Text.ToString(), out idint); int worth; int.TryParse(id.Text.ToString(), out worth); DateTime expDate = DateTime.Now; String prov = provider.Text.ToString(); String itemID = item.Text.ToString(); if (date.SelectedDate != null) { expDate = (DateTime)date.SelectedDate; } if (String.IsNullOrWhiteSpace(prov) || String.IsNullOrWhiteSpace(itemID)) { MessageBox.Show("Fields must be field out"); return; } if (button.Content.ToString().Equals("ADD")) { //MessageBox.Show(expDate.ToString()); InsureInfo.Add(prov, expDate, itemID, worth); MessageBox.Show("New Item Added!"); this.Close(); } else if (button.Content.ToString().Equals("Edit")) { InsureInfo.Edit(idint, prov, expDate, ""); infoDialog ii = new infoDialog("Insurance Update", "You have successfully Updated your data"); ii.ShowDialog(); this.Close(); } }
public void load_All() { all = InsureInfo.GetAll(); data.listView.ItemsSource = all; }
public DataPage() { InitializeComponent(); all = InsureInfo.GetAll(); }