Created
November 18, 2011 00:56
-
-
Save bdallen/1375162 to your computer and use it in GitHub Desktop.
Blah
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (ISession session = Global._DatabaseConn.OpenSession()) | |
{ | |
using (ITransaction transaction = session.BeginTransaction()) | |
{ | |
// Get list of all Leases | |
//Leases = session.CreateCriteria(typeof(normutils.data.Entities.DHCPLease)).List<normutils.data.Entities.DHCPLease>(); | |
var LQ = session.Query<normutils.data.Entities.DHCPLease>(); | |
var Leases = from v in LQ | |
where v.BindState == "active" | |
orderby v.Name ascending | |
select v; | |
} | |
} | |
foreach (normutils.data.Entities.DHCPLease Lease in Leases) | |
{ | |
if (Lease.BindState == "active") | |
{ | |
ListViewItem lvi = new ListViewItem(Lease.Name); | |
lvi.SubItems.Add(Lease.IPAddress); | |
lvi.SubItems.Add(Lease.ID); | |
lvi.SubItems.Add(Lease.StartDate.ToString("yyyy-MM-dd HH:mm:ss")); | |
lvi.SubItems.Add(GetManufacturer(Lease.ID)); | |
lvLeases.Items.Add(lvi); | |
} | |
} | |
} |
Azerothian
commented
Nov 18, 2011
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment