public void Location_Can_Edit() { var location = new Location {Id=1, AddressId = 1, CreatedByUserId = 1, CreatedDate = new DateTime(2013,1,1), ModifiedByUserId = 2, ModifiedDate = new DateTime(2013,1,2), Name = "Flannagan's Dublinzzzzzzzz", NickName = "Flans"}; var repo = new Dig.Data.Repositories.LocationRepository(); repo.Update(location); }
public void Delete(Location model) { using (var session = NhibernateHelper.OpenSession()) using (var transaction = session.BeginTransaction()) { session.Delete(model); transaction.Commit(); } }
public void Inactivate(Location model) { model.ModifiedByUserId = _userId; model.ModifiedDate = DateTime.Now; model.IsActive = false; using (var session = NhibernateHelper.OpenSession()) using (var transaction = session.BeginTransaction()) { session.Update(model); transaction.Commit(); } }
public void Add(Location model) { model.CreatedByUserId = _userId; model.CreatedDate = DateTime.Now; model.ModifiedByUserId = _userId; model.ModifiedDate = DateTime.Now; using (var session = NhibernateHelper.OpenSession()) using (var transaction = session.BeginTransaction()) { session.Save(model); transaction.Commit(); } }
public void Location_Can_Add() { var location = new Location() { AddressId = 0, CreatedByUserId = 0, CreatedDate = new DateTime(2013, 1, 1), Id = 1, ModifiedByUserId = 0, ModifiedDate = new DateTime(2013, 1, 1), Name = "Test", NickName = "Testerasdf" }; var repo = new Dig.Data.Repositories.LocationRepository(); repo.Add(location); }