Example #1
0
        /// <summary>
        /// Uvm_s the read all orgs for user complete.
        /// </summary>
        /// <param name="userOrganizationDtoList">The user organization dto list.</param>
        /// <param name="ex">The ex.</param>
        void uvm_ReadAllOrgsForUserComplete(System.Collections.Generic.List <OrganizationDto> userOrganizationDtoList, Exception ex)
        {
            cmbOrgName.ItemsSource       = userOrganizationDtoList;
            cmbOrgName.DisplayMemberPath = "Name";
            cmbOrgName.SelectedValuePath = "Id";
            cmbOrgName.SelectedIndex     = 0;

            // After we get all orgs for the user get all datasources  for this org
            adminDSVM = new AdminDatasourceViewModel();
            int orgId = ((OrganizationDto)cmbOrgName.SelectedItem).Id;

            adminDSVM.Read(orgId);
            adminDSVM.ReadCompletedEvent += new EventHandler <SimpleMvvmToolkit.NotificationEventArgs <Exception> >(adminVM_ReadCompletedEvent);

            // set the dropdown to the right org
            foreach (object item in cmbOrgName.Items)
            {
                ComboBoxItem ciForType = item as ComboBoxItem;

                OrganizationDto oDto = item as OrganizationDto;
                if (oDto.Id == orgId)
                {
                    cmbOrgName.SelectedItem = item;
                }
            }
        }
Example #2
0
        /// <summary>
        /// Handles the SelectedOrganizationChanged event of the LoggedInUser control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        void LoggedInUser_SelectedOrganizationChanged(object sender, EventArgs e)
        {
            //read all the users in my organization including superadmin, admin and analysts.
            int orgId = Convert.ToInt32(sender); //((OrganizationDto)cmbOrgName.SelectedItem).Id;

            adminDSVM.Read(orgId);
            spMsg.Visibility = System.Windows.Visibility.Collapsed;
            //  NOTE:
            //  A listener has already been wired to this event so it does not have to be wired again ( memeory leak  )
            //  uvm.ReadAllUsersLoaded += new EventHandler(uvm_ReadAllUsersLoaded);
        }
Example #3
0
 /// <summary>
 /// Reads all datasources.
 /// </summary>
 private void ReadAllDatasources()
 {
     advm.Read(this.SelectedOrg.Id);
     advm.ReadCompletedEvent += new EventHandler <SimpleMvvmToolkit.NotificationEventArgs <Exception> >(advm_ReadCompletedEvent);
 }
Example #4
0
 /// <summary>
 /// Requests the read.
 /// </summary>
 private void RequestRead()
 {
     adminVM.Read(OrganizationId);
     adminVM.ReadCompletedEvent += new EventHandler <SimpleMvvmToolkit.NotificationEventArgs <Exception> >(adminVM_ReadCompletedEvent);
 }