Beispiel #1
0
 private void btnBackToEvent_Click(object sender, RoutedEventArgs e)
 {
     lblWhereWeAre.Content = "Мероприятия";
     CDataBase.TableWrite(path, "Мероприятия", eventsGridData);
     slideAnimationTo(eventGrid);
     slideAnimationFrom(fullEventGrid);
 }
Beispiel #2
0
 private void mainWindow_Initialized(object sender, EventArgs e)
 {
     CDataBase.TableWriteLimit(path, "Мероприятия", homeEventsGridData);
     CDataBase.TableWriteLimit(path, "ДР", homeBirthDayGridData);
     eventGrid.Visibility     = Visibility.Hidden;
     birhtDayGrid.Visibility  = Visibility.Hidden;
     newEventGrid.Visibility  = Visibility.Hidden;
     fullEventGrid.Visibility = Visibility.Hidden;
     btnNewEvent.Visibility   = Visibility.Hidden;
     synthesizer.Rate         = 2;
 }
Beispiel #3
0
 private void btnBirthDay_Click(object sender, RoutedEventArgs e)
 {
     lblWhereWeAre.Content    = "Дни Рождения";
     fullEventGrid.Visibility = Visibility.Hidden;
     newEventGrid.Visibility  = Visibility.Hidden;
     birhtDayGrid.Visibility  = Visibility.Visible;
     homeGrid.Visibility      = Visibility.Hidden;
     eventGrid.Visibility     = Visibility.Hidden;
     CDataBase.TableWrite(path, "ДР", birthDayGridData);
     slideAnimationTo(birhtDayGrid);
 }
Beispiel #4
0
 private void btnHomePage_Click(object sender, RoutedEventArgs e)
 {
     lblWhereWeAre.Content    = "Электронный секретарь";
     newEventGrid.Visibility  = Visibility.Hidden;
     fullEventGrid.Visibility = Visibility.Hidden;
     birhtDayGrid.Visibility  = Visibility.Hidden;
     homeGrid.Visibility      = Visibility.Visible;
     eventGrid.Visibility     = Visibility.Hidden;
     CDataBase.TableWriteLimit(path, "Мероприятия", homeEventsGridData);
     slideAnimationTo(homeGrid);
 }
Beispiel #5
0
 private void btnEvents_Click(object sender, RoutedEventArgs e)
 {
     lblWhereWeAre.Content    = "Мероприятия";
     fullEventGrid.Visibility = Visibility.Hidden;
     eventGrid.Visibility     = Visibility.Visible;
     btnNewEvent.Visibility   = Visibility.Visible;
     newEventGrid.Visibility  = Visibility.Hidden;
     birhtDayGrid.Visibility  = Visibility.Hidden;
     homeGrid.Visibility      = Visibility.Hidden;
     CDataBase.TableWrite(path, "Мероприятия", eventsGridData);
     slideAnimationTo(eventGrid);
 }
Beispiel #6
0
        //Удаление мероприятия
        private void btnDeleteEvent_Click(object sender, EventArgs e)
        {
            int code, parse;

            parse = eventsGridData.SelectedIndex;
            DataRowView dataRow = eventsGridData.SelectedValue as DataRowView;

            code = int.Parse(dataRow[0].ToString());
            var mbResult = MessageBox.Show("Вы действительно хотите удалить мероприятие?", "Удаление мероприятия",
                                           MessageBoxButton.YesNo);

            if (mbResult == MessageBoxResult.Yes)
            {
                CDataBase.EventRowDelete(path, code);
                CDataBase.TableWrite(path, "Мероприятия", eventsGridData);
            }
        }
Beispiel #7
0
        //Добавление мероприятия
        private void btnAddEvent_Click(object sender, RoutedEventArgs e)
        {
            String date, name, description;

            if (tbEventName.Text.ToString() == "")
            {
                MessageBox.Show("Вы не задали название мероприятия"); return;
            }
            name = tbEventName.Text.ToString();
            if (tbEventDescription.Text.ToString() == "")
            {
                MessageBox.Show("Вы не задали описание мероприятия"); return;
            }
            description = tbEventDescription.Text.ToString();
            if (timeOfEvent.Text.ToString() == "")
            {
                MessageBox.Show("Вы не задали время мероприятия"); return;
            }
            date = dateOfEvent.Text.ToString() + " " + timeOfEvent.Text.ToString();
            if (DateTime.Parse(date) < DateTime.Now)
            {
                MessageBox.Show("Время заданного вами мероприятия прошло"); return;
            }

            CDataBase.insertEvent(path, date, name, description);

            lblWhereWeAre.Content    = "Мероприятия";
            birhtDayGrid.Visibility  = Visibility.Hidden;
            homeGrid.Visibility      = Visibility.Hidden;
            fullEventGrid.Visibility = Visibility.Hidden;
            eventGrid.Visibility     = Visibility.Visible;
            CDataBase.TableWrite(path, "Мероприятия", eventsGridData);
            slideAnimationTo(eventGrid);
            slideAnimationFrom(newEventGrid);
            MessageBox.Show("Мероприятие успешно добавлено!");
        }