/// <summary> /// Handles the Loaded event of the Organization control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs" /> instance containing the event data.</param> void Organization_Loaded(object sender, RoutedEventArgs e) { if (ApplicationViewModel.Instance.AuthenticationMode.ToString().ToLower() == "windows") { grdWindows.Visibility = System.Windows.Visibility.Visible; grdForms.Visibility = System.Windows.Visibility.Collapsed; } else { grdWindows.Visibility = System.Windows.Visibility.Collapsed; grdForms.Visibility = System.Windows.Visibility.Visible; } organizationViewModel = new OrganizationViewModel(); organizationViewModel.DtoRead += new EventHandler <NotificationEventArgs <Exception> >(organizationViewModel_DtoRead); organizationViewModel.ReadAll(); //dgOrg.ItemsSource = null; //dgOrg.ItemsSource = organizationViewModel.OrganizationDtoList; SwitchMode(UserConrolUIMode.ShowList); }
/// <summary> /// Handles the Closed event of the aeo control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs" /> instance containing the event data.</param> void aeo_Closed(object sender, EventArgs e) { AddEditOrganization aeo = (AddEditOrganization)sender as AddEditOrganization; if (aeo.DialogResult == true) { aeo.Closed -= new EventHandler(aeo_Closed); organizationViewModel = new OrganizationViewModel(); organizationViewModel.DtoRead += new EventHandler <NotificationEventArgs <Exception> >(organizationViewModel_DtoRead); organizationViewModel.ReadAll(); spMsg.Visibility = System.Windows.Visibility.Visible; if (addEditMode == AddEditMode.Add) { SucessMsg.Text = "Organization " + aeo.tbOrganizationName.Text + " has been added."; } else { SucessMsg.Text = "Organization " + aeo.tbOrganizationName.Text + " has been updated."; } waitCursor.Visibility = System.Windows.Visibility.Visible; } }
/// <summary> /// Organizations the view model_ dto updated. /// </summary> /// <param name="e">The e.</param> void organizationViewModel_DtoUpdated(object sender, NotificationEventArgs <Exception> e) { organizationViewModel.ReadAll(); DialogResult = true; }
/// <summary> /// Handles the DtoAdded event of the organizationViewModel control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="SimpleMvvmToolkit.NotificationEventArgs<System.Exception>" /> instance containing the event data.</param> void organizationViewModel_DtoAdded(object sender, NotificationEventArgs <Exception> e) { organizationViewModel = new OrganizationViewModel(); organizationViewModel.DtoRead += new EventHandler <NotificationEventArgs <Exception> >(organizationViewModel_DtoRead); organizationViewModel.ReadAll(); }