2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
|
|
|
|
|
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
|
|
|
|
///
|
|
|
|
|
|
using System;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
using NHibernate;
|
|
|
|
|
|
using FluentNHibernate;
|
|
|
|
|
|
|
2015-12-04 16:17:20 +00:00
|
|
|
|
namespace Config.Entities
|
2014-07-28 07:54:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class Watermeter
|
|
|
|
|
|
{
|
|
|
|
|
|
public virtual int Id { get; protected set; } /// primary key
|
|
|
|
|
|
|
|
|
|
|
|
public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change
|
|
|
|
|
|
public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure
|
|
|
|
|
|
public virtual string CreateDescription { get; set; } /// Description
|
|
|
|
|
|
|
|
|
|
|
|
/// mapped
|
|
|
|
|
|
public virtual string Serial { get; set; } /// serial number
|
|
|
|
|
|
public virtual WMType WMType { get; set; } /// type of watermeter
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Load a watermeter from the database
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static Watermeter LoadBySerialnr(string SerialNr)
|
|
|
|
|
|
{
|
2017-03-16 20:53:12 +00:00
|
|
|
|
IList<Watermeter> ListOfWatermeters = FluentCommon.CreateSession(Users.Entities.DBKind.Results)
|
2014-07-28 07:54:35 +00:00
|
|
|
|
.CreateQuery("FROM Watermeter WHERE Serial = :SerialNrParameter")
|
|
|
|
|
|
.SetParameter("SerialNrParameter", SerialNr)
|
|
|
|
|
|
.List<Watermeter>();
|
|
|
|
|
|
if (ListOfWatermeters.Count > 0) return ListOfWatermeters.ElementAt(0);
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|