Exemple #1
0
        private void btnAddToFavorites_Clicked(object sender, EventArgs args)
        {
            if (MainWindow.IsAdmin)
            {
                AddToFavorites();
                return;
            }
            var verifyPanel = new VerifyPanel((s, e) => {
                AddToFavorites();
            }, (s, e) => {
                MainWindow.SetContent(this);
            });

            MainWindow.SetContent(verifyPanel);
        }
        private void btnImportData_Clicked(object sender, EventArgs args)
        {
            if (MainWindow.IsAdmin)
            {
                Import();
                return;
            }
            var verifyPanel = new VerifyPanel((s, e) =>
            {
                Import();
            }, (s, e) =>
            {
                MainWindow.SetContent(this);
            });

            MainWindow.SetContent(verifyPanel);
        }
        private void btnSend_Clicked(object sender, EventArgs args)
        {
            if (MainWindow.IsAdmin)
            {
                Create();
                return;
            }
            var verifyPanel = new VerifyPanel((s, e) =>
            {
                Create();
            }, (s, e) =>
            {
                if (isEdit)
                {
                    people = oldPeople;
                }
                MainWindow.SetContent(this);
            });

            MainWindow.SetContent(verifyPanel);
        }
Exemple #4
0
        private void btnRemove_Clicked(object sender, EventArgs args)
        {
            var item        = (sender as ImageButton).Tag as Appointment;
            var verifyPanel = new VerifyPanel((s, e) =>
            {
                Database.SavedData.Appointments.RemoveAll(x => x.Id == item.Id);
                Database.Save();

                var appointments = Database.SavedData.Appointments.Where(x => x.Date.Date == datePicker.SelectedDate.Value.Date).OrderBy(x => x.BeginHour);

                lsAppointments.ItemsSource = null;
                lsAppointments.ItemsSource = appointments;

                txtWarning.Visibility = appointments.Any() ? Visibility.Collapsed : Visibility.Visible;

                MainWindow.SetContent(this);
            }, (s, e) =>
            {
                MainWindow.SetContent(this);
            });

            MainWindow.SetContent(verifyPanel);
        }