Esempio n. 1
0
        public Dashboard()
        {
            InitializeComponent();

            InData consumo = new InData();

            DataContext = new InDataViewModel(consumo);

            total.Text   = InsureInfo.total().ToString();
            updates.Text = Notification.GetCount().ToString();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
        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();
            }
        }
Esempio n. 5
0
 public void load_All()
 {
     all = InsureInfo.GetAll();
     data.listView.ItemsSource = all;
 }
Esempio n. 6
0
 public DataPage()
 {
     InitializeComponent();
     all = InsureInfo.GetAll();
 }