public ActionResult Index(Guid?Id) { Driver driver = new Driver(); if (Id.HasValue && Id != Guid.Empty) { driver = NeoStore.Get <Driver>(Id.Value); } return(View(driver)); }
public virtual bool DetachDelete() { using (var tx = NeoStore.BeginTransaction()) { this.OnDeleting(); bool ret = NeoStore.DetachDelete(this); this.OnDeleted(); tx.Commit(); return(ret); } }
public virtual bool Update(bool replaceEntry = false) { using (var tx = NeoStore.BeginTransaction()) { if (this.Id.Equals(Guid.Empty)) { this.TimeCreated = DateTime.UtcNow; } this.TimeLastModified = DateTime.UtcNow; this.OnUpdating(); bool ret = NeoStore.Save(this, replaceEntry); this.OnUpdated(); tx.Commit(); return(ret); } }
public JsonResult Edit(Guid id, string companyIdentifier, string lastname, string firstname, string neoUrl, string neoPort, string neoUser, string neoPassword) { try { Driver driver = new Driver(); if (!string.IsNullOrEmpty(neoUrl)) { NeoStore.neo4jIP = neoUrl; NeoStore.neo4jLogin = neoUser; NeoStore.neo4jPassword = neoPassword; NeoStore.neo4jPort = neoPort; } if (NeoStore.Connect()) { using (var tx = NeoStore.BeginTransaction()) { if (id != Guid.Empty) { driver = NeoStore.Get <Driver>(id); } driver.CompanyIdentifier = companyIdentifier; driver.Firstname = firstname; driver.Lastname = lastname; driver.Update(); tx.Commit(); } } } catch (Exception ex) { return(Json(new { success = false, responseText = ex.Message })); } return(Json(new { success = true, responseText = "OK", driverId = "", isNew = false })); }
public virtual void AcquireWriteLock() { NeoStore.AcquireWriteLock(this); }
public static T Get() => NeoStore.GetGlobal<T>();
public bool Save() { return NeoStore.SaveGlobal(this); }
public static Neo4jClient.Transactions.ITransaction BeginNeo4JTransaction(Neo4jClient.Transactions.TransactionScopeOption option = Neo4jClient.Transactions.TransactionScopeOption.Join) => NeoStore.BeginTransaction(option);