public BoardsWindow(UserController service) { InitializeComponent(); this.service = service; this.bwdc = new BoardsWindowDataContext(service); this.DataContext = this.bwdc; }
private void AddBtn_Click(object sender, RoutedEventArgs e) { if (this.bwdc.NewBoardName != null && !this.bwdc.NewBoardName.Equals("")) { if (this.service.AddBoard(this.bwdc.NewBoardName)) { MessageBox.Show("Board added successfully"); this.bwdc = new BoardsWindowDataContext(service); BoardsWindow boardsWindow = new BoardsWindow(service); boardsWindow.Show(); this.Close(); } else { MessageBox.Show("Board with this name is already exists"); } } else { MessageBox.Show("Please select a boardName"); } }