internal void RunCalls()
        {
            AdClients adClients = GetAllAdClients();

            // Get a host ad client ID, so we can run the rest of the samples.
            // Make sure it's a host ad client.
            AdClient exampleAdClient = FindAdClientForHost(adClients.Items);

            if (exampleAdClient != null)
            {
                // Custom Channels: List, Add, Update, Delete
                CustomChannels hostCustomChannels = GetAllCustomChannels(exampleAdClient.Id);
                CustomChannel  newCustomChannel   = AddCustomChannel(exampleAdClient.Id);
                newCustomChannel = UpdateCustomChannel(exampleAdClient.Id, newCustomChannel.Id);
                DeleteCustomChannel(exampleAdClient.Id, newCustomChannel.Id);

                // URL Channels: List, Add, Delete
                GetAllUrlChannels(exampleAdClient.Id);
                UrlChannel newUrlChannel = AddUrlChannel(exampleAdClient.Id);
                DeleteUrlChannel(exampleAdClient.Id, newUrlChannel.Id);

                GenerateReport(service, exampleAdClient.Id);
            }
            else
            {
                Console.WriteLine("No host ad clients found, unable to run remaining host samples.");
            }
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();

            if (Authorization.CheckGroups(_domainName, _grouptoCheck))
            {
                _adClient = new AdClient(_domainName);

                Credentials.Content = "|  " + Environment.UserDomainName + "\\" + Environment.UserName;
                Classes.NLog.AuthToLog("User logged");

                NamesGroup            = _adClient.LoadUsersGroup(_workAdGroup);
                ListGroup.ItemsSource = NamesGroup;

                //добавляем сортировку по алфавиту в ListGroup
                ListGroup.Items.SortDescriptions.Add(
                    new System.ComponentModel.SortDescription("Name",
                                                              System.ComponentModel.ListSortDirection.Ascending));

                //для фильтрации
                CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(ListGroup.ItemsSource);
                view.Filter = UserFilter;

                //селектим GroupCombo
                GroupCombo.SelectedIndex = 0;
            }
            else
            {
                Classes.NLog.AuthToLog("Access denied");
                MessageBox.Show("Похоже, у вас нет прав." + Environment.NewLine + "Обратитесь в техническую поддержку [email protected].");
                Application.Current.Shutdown();
            }
        }
Example #3
0
        public ActionResult Report(int id)
        {
            AdClient client = controller.GetAdClient(id);

            SetPageMetaData();
            return(View(client));
        }
Example #4
0
        public void test_creation_of_ad()
        {
            AdClient adclient = new AdClient();

            adclient.Open();

            Ad ad = new Ad()
            {
                AccountId = 1, AdLocation = "nairobi", AdDescription = "Looking for a housegirl"
            };
            Ad returnedad = adclient.CreateAd(ad, "");

            Assert.IsTrue(ad == returnedad);
        }
Example #5
0
        public void test_ad_client_connection()
        {
            AdClient adclient = new AdClient();

            adclient.Open();
        }