コード例 #1
0
        /// <summary>
        /// Obsluha editace meetingu, datum se vybira o uroven vyse.
        /// Slo by pridat DatePicker i do tohoto dialogu a tim presouvat meetingy na jine datum. Nedelam z casovych duvodu, ale neni slozite.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Meeting_Edit(object sender, RoutedEventArgs e)
        {
            if (listMeetings.SelectedIndex == -1)
            {
                MessageBox.Show("Select meeting first.");
            }
            else
            {
                MeetingWindow meetingWindow = new MeetingWindow();
                meetingWindow.m      = (Meeting)listMeetings.SelectedItem;
                meetingWindow.m.Date = selectDate.SelectedDate.ToString();
                meetingWindow.SetData();

                bool?result = meetingWindow.ShowDialog();

                if (result == true)
                {
                    RefreshMeetings();
                }
                else
                {
                    // uzivatel nic neodeslal
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// Vytvoreni noveho meetingu
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button_Meeting_New(object sender, RoutedEventArgs e)
 {
     // kontrola, jestli byl vybran datum
     if (selectDate.SelectedDate.ToString().Equals(""))
     {
         MessageBox.Show("Select date first.");
     }
     else
     {
         // vytvoreni noveho meetingu
         MeetingWindow meetingWindow = new MeetingWindow();
         bool?         result        = meetingWindow.ShowDialog();
         if (result == true)
         {
             ((MeetingRoom)selectMR.SelectedItem).AddMeeting(selectDate.SelectedDate.ToString(), meetingWindow.HoursFrom, meetingWindow.MinutesFrom, meetingWindow.HoursTo, meetingWindow.MinutesTo, meetingWindow.ExpectedPersons, meetingWindow.Customer, meetingWindow.Note, meetingWindow.VideoConference);
         }
         else
         {
             // uzivatel nic neodeslal, nechavam pro pripad, ze bych neco doplnil
         }
         RefreshMeetings();
     }
 }