-
-
Save Azerothian/1375166 to your computer and use it in GitHub Desktop.
Blah
This file contains hidden or 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
List<normutils.data.Entities.DHCPLease> _leases; | |
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>(); | |
_leases = (from v in LQ | |
where v.BindState == "active" | |
orderby v.Name ascending | |
select v),ToList(); | |
} | |
} | |
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); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment