public void EditStandartSize(IStandartSize aStandartSize) { using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { var entity = session.Get<StandartSizeEntity>(aStandartSize.GetId()); entity.Height = aStandartSize.GetHeight(); entity.Width = aStandartSize.GetWidth(); entity.Length = aStandartSize.GetLength(); session.Update(entity); transaction.Commit(); } } }
public int AddStandartSize(IStandartSize aStandartSize) { var entity = new StandartSizeEntity { Height = aStandartSize.GetHeight(), Width = aStandartSize.GetWidth(), Length = aStandartSize.GetLength() }; using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { session.Save(entity); transaction.Commit(); } } return entity.Id; }