Example #1
0
        protected void _btnSearch_Click(object sender, EventArgs e)
        {
            _btnShowList.Visible = true;
            string Search = null;

            DataSourceClient.SelectParameters.Clear();
            if (IsPostBack)
            {
                Search = _txtSearch.Text.Trim();
                DataSourceClient.SelectParameters.Add("Search", Search);
                DataSourceClient.SelectCommand = "SELECT * FROM CLIENT WHERE CLIENTNAME like'%'+@Search+'%' OR CLIENTADDR like'%'+@Search+'%' OR CLIENTCITY like'%'+@Search+'%' OR CLIENTPROV like'%'+@Search+'%' OR CLIENTEMAIL like'%'+@Search+'%' OR CLIENTCELL like'%'+@Search+'%' OR CLIENTTEL like'%'+@Search+'%'";
                DataSourceClient.DataBind();
                _listviewClient.DataBind();
            }
        }
Example #2
0
        public void Load()
        {
            var stopwatch = Stopwatch.StartNew();

            Console.WriteLine("Loading projects..");

            var client = new DataSourceClient();

            var mostRecentInSource = client.GetMostRecentResource();
            var mostRecentInDb     = ResourceRepository.GetMostRecentResource();

            if (NoResourcesInDbYet(mostRecentInDb) ||
                WasNewResourceAdded(mostRecentInSource, mostRecentInDb) ||
                WasLastResourceUpdated(mostRecentInSource, mostRecentInDb))
            {
                Console.WriteLine("New or updated reasource found. Downloading..");

                var downloadedResource = client.DownloadResource(mostRecentInSource);
                var projectLoader      = new ProjectLoader(new OpenXmlResourceReader());

                Console.WriteLine("Reading resource..");

                var projectsInResource = projectLoader.Read(downloadedResource);
                var newProjects        = ProjectRepository.FilterAlreadyExistingProjects(projectsInResource);

                Console.WriteLine($"{newProjects.Count()} new projects found. Adding to DB..");

                ProjectRepository.AddOrUpdateMany(newProjects);
                ResourceRepository.AddOrUpdate(mostRecentInSource);

                client.DeleteTemporaryDirectory();

                Console.WriteLine("Loading projects done.");
            }
            else
            {
                Console.WriteLine("No project to add..");
            }

            stopwatch.Stop();
            Console.WriteLine($"Took {stopwatch.Elapsed}");
        }
		public ZeitgeistClient ()
		{
			dsReg = new DataSourceClient ();

			MonoDevelop.Core.LoggingService.LogInfo ("Zg#: init new");

			Event ev = new Event ();
			ev.Actor = MonoDevelopUri;
			Subject sub = new Subject ();
			sub.Interpretation = Interpretation.Instance.Document.Document;
			sub.Manifestation = Manifestation.Instance.FileDataObject.FileDataObject;
			ev.Subjects.Add (sub);

			try {
				dsReg.RegisterDataSources (monodevelopDataSourceId,
					monodevelopDataSourceName,
					monodevelopDataSourceDesc,
					new List<Event> (){ev});
				client = new LogClient ();
			} catch (Exception ex) {
				MonoDevelop.Core.LoggingService.LogError ("Error init", ex);
			}
		}
        void IExtensionService.Initialize()
        {
            try {
                client = new LogClient();
                if (client != null)
                {
                    Log.Debug("Zeitgeist client created");

                    // Try to register the datasource in DataSource registry
                    dsReg = new DataSourceClient();

                    try {
                        // Register the datasource/dataprovider
                        dsReg.RegisterDataSources(bansheeDataSourceId,
                                                  bansheeDataSourceName,
                                                  bansheeDataSourceDesc,
                                                  PopulateAllDataSourceTemplates()
                                                  );
                    }
                    catch (Exception exp) {
                        // Nazi exception handler
                        // Can be fixed when zeitgeist-sharp is migrated from ndesk-dbus to dbus-sharp
                        Log.Exception(exp);
                    }

                    // Handle the events
                    ServiceManager.PlaybackController.Stopped += HandleServiceManagerPlaybackControllerStopped;
                    ServiceManager.PlayerEngine.ConnectEvent(playerEvent_Handler, PlayerEvent.StartOfStream | PlayerEvent.EndOfStream);
                }
                else
                {
                    Log.Warning("Could not create Zeitgeist client");
                }
            } catch (Exception e) {
                Log.Exception(e);
            }
        }
Example #5
0
 protected override ICommunicationObject CreateProxy()
 {
     client = new DataSourceClient();
     return(client);
 }
        void IExtensionService.Initialize()
        {
            try {
                client = new LogClient ();
                if (client != null) {
                    Log.Debug("Zeitgeist client created");

                    // Try to register the datasource in DataSource registry
                    dsReg = new DataSourceClient();

                    try {
                        // Register the datasource/dataprovider
                        dsReg.RegisterDataSources(bansheeDataSourceId,
                                                    bansheeDataSourceName,
                                                    bansheeDataSourceDesc ,
                                                    PopulateAllDataSourceTemplates()
                                                  );
                    }
                    catch(Exception exp) {
                        // Nazi exception handler
                        // Can be fixed when zeitgeist-sharp is migrated from ndesk-dbus to dbus-sharp
                        Log.Exception(exp);
                    }

                    // Handle the events
                    ServiceManager.PlaybackController.Stopped += HandleServiceManagerPlaybackControllerStopped;
                    ServiceManager.PlayerEngine.ConnectEvent(playerEvent_Handler, PlayerEvent.StartOfStream | PlayerEvent.EndOfStream);

                } else {
                    Log.Warning ("Could not create Zeitgeist client");
                }
            } catch (Exception e) {
                Log.Exception (e);
            }
        }