//------------------------------------------------------------------------------ // <auto-generated> // Этот код создан программой. // Исполняемая версия:2.0.50727.3053 // // Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае // повторной генерации кода. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collections.Generic; using NHibernate; using NHibernate.Criterion; using InfoCenter.Persistence; using InfoCenter.Persistence.Core; using InfoCenter.Persistence.Entities; namespace InfoCenter.WebConsole { public partial class Default : System.Web.UI.Page { IRepository<Computer> computers; IRepository<Process> processes; protected override void OnLoad (EventArgs e) { ISessionFactory sessionFactory = Initializer.GetSessionFactory(false); computers = new Repository<Computer>(sessionFactory); processes = new Repository<Process>(sessionFactory); DetachedCriteria criteria = DetachedCriteria.For<Computer>() .Add(NHibernate.Criterion.Expression.Like("Name","%")); IList<Computer> list = new List<Computer>(); foreach(Computer item in computers.FindAll(criteria)) list.Add(item); computersList.DataSource = list; computersList.DataBind(); base.OnLoad (e); } protected void ComputersList_ItemCommand(object source, DataListCommandEventArgs e) { string compName = e.CommandArgument.ToString(); lblCurrentComp.Text = String.Format(@"<b>Processes on computer '{0}':</b>",compName); DetachedCriteria criteria = DetachedCriteria.For<Process>().CreateAlias("Host","c") .Add(NHibernate.Criterion.Expression.Eq("c.Name",compName)); IList<Process> list = new List<Process>(); foreach(Process item in processes.FindAll(criteria)) list.Add(item); processesGrid.DataSource = list; processesGrid.DataBind(); } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)