public void DeleteUnitOfMeasure(UnitOfMeasure uom)
 {
     using (ISession session = HibernateProvider.Factory.OpenSession())
     {
         session.Delete(uom);
         session.Flush();
     }
 }
 public void InsertUnitOfMeasure(UnitOfMeasure uom)
 {
     using (ISession session = HibernateProvider.Factory.OpenSession())
     {
         session.SaveOrUpdate(uom);
         session.Flush();
     }
 }
 /// <summary>
 /// Create a new UnitOfMeasure object.
 /// </summary>
 /// <param name="unitOfMeasureID">Initial value of the UnitOfMeasureID property.</param>
 /// <param name="unitOfMeasureTag">Initial value of the UnitOfMeasureTag property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 public static UnitOfMeasure CreateUnitOfMeasure(global::System.Byte unitOfMeasureID, global::System.String unitOfMeasureTag, global::System.String description)
 {
     UnitOfMeasure unitOfMeasure = new UnitOfMeasure();
     unitOfMeasure.UnitOfMeasureID = unitOfMeasureID;
     unitOfMeasure.UnitOfMeasureTag = unitOfMeasureTag;
     unitOfMeasure.Description = description;
     return unitOfMeasure;
 }
        public List<UnitOfMeasure> LoadUnitOfMeasures(string whereClause)
        {
            List<UnitOfMeasure> umList = new List<UnitOfMeasure>();

            string sqlQuery = "SELECT * FROM " + UnitOfMeasure._tableName;
            sqlQuery += ((whereClause != null && whereClause.Length > 0) ? " WHERE " + whereClause : "");

            try
            {
                OleDbCommand sqlCommand = new OleDbCommand(sqlQuery, _accessConnection);
                OleDbDataReader reader = sqlCommand.ExecuteReader();

                while (reader.Read())
                {
                    UnitOfMeasure newUm = new UnitOfMeasure();
                    newUm.Load(reader);
                    umList.Add(newUm);
                }
            }
            catch (Exception e)
            {
            }

            return umList;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the UnitOfMeasures EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUnitOfMeasures(UnitOfMeasure unitOfMeasure)
 {
     base.AddObject("UnitOfMeasures", unitOfMeasure);
 }