Пример #1
0
 private void InitializeDataGrid()
 {
     EventDBContext.IntitalizeDB();
     events = EventDBContext.GetEvents();
     EventDataGrid.Items.Clear();
     foreach (EventDBContext eventt in events)
     {
         EventDataGrid.Items.Add(eventt);
     }
 }
Пример #2
0
 private void SaveButton_Click(object sender, RoutedEventArgs e)
 {
     if (ValidateAll())
     {
         EventDBContext.IntitalizeDB();
         EventDBContext.Inserst(EventDate.Text.ToString(), EventAdress.Text.ToString(), EventDetail.Text.ToString().Trim());
         InitializeDataGrid();
         ClearAll();
         WindowSuccess success = new WindowSuccess();
         success.SetContent("Event Saved Succefully");
         success.Show();
     }
     else
     {
         WindowError error = new WindowError();
         error.SetContent("Empty Filed Or Invalid Input");
         error.Show();
     }
 }
Пример #3
0
 private void DeleteButton_Click(object sender, RoutedEventArgs e)
 {
     if (eventId != 0)
     {
         EventDBContext.IntitalizeDB();
         EventDBContext.Delete(eventId);
         InitializeDataGrid();
         ClearAll();
         WindowSuccess success = new WindowSuccess();
         success.SetContent("Event Deleted Succefully");
         success.Show();
     }
     else
     {
         WindowError error = new WindowError();
         error.SetContent("Event Is Not Selected");
         error.Show();
     }
 }
Пример #4
0
 private void UpdateButton_Click(object sender, RoutedEventArgs e)
 {
     if (ValidateAll() && eventId != 0)
     {
         EventDBContext.IntitalizeDB();
         EventDBContext.Update(eventId, EventDate.Text.ToString(), EventAdress.Text.ToString(), EventDetail.Text.ToString().Trim());
         InitializeDataGrid();
         ClearAll();
         WindowSuccess success = new WindowSuccess();
         success.SetContent("Event Updated Succefully");
         success.Show();
     }
     else
     {
         WindowError error = new WindowError();
         error.SetContent("Event Is Not Selected");
         error.Show();
     }
 }