コード例 #1
0
 private void btnBackToEvent_Click(object sender, RoutedEventArgs e)
 {
     lblWhereWeAre.Content = "Мероприятия";
     CDataBase.TableWrite(path, "Мероприятия", eventsGridData);
     slideAnimationTo(eventGrid);
     slideAnimationFrom(fullEventGrid);
 }
コード例 #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;
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
            }
        }
コード例 #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("Мероприятие успешно добавлено!");
        }