public ActionResult Pull() { var response = new PullResponseBuilder(this.AllorsUser); response.AddObject("person", this.AllorsUser); return(this.JsonSuccess(response.Build())); }
public IActionResult Pull([FromBody] Model model) { var acls = new WorkspaceAccessControlLists(this.allors.Session.GetUser()); var response = new PullResponseBuilder(acls, this.TreeService); var organisationContactRelationship = (OrganisationContactRelationship)this.allors.Session.Instantiate(model.Id); response.AddObject("organisationContactRelationship", organisationContactRelationship); response.AddObject("contact", organisationContactRelationship.Contact); var locales = new Locales(this.allors.Session).Extent(); response.AddCollection("locales", locales); var genders = new GenderTypes(this.allors.Session).Extent(); response.AddCollection("genders", genders); var salutations = new Salutations(this.allors.Session).Extent(); response.AddCollection("salutations", salutations); var contactKinds = new OrganisationContactKinds(this.allors.Session).Extent(); response.AddCollection("organisationContactKinds", contactKinds); return(this.Ok(response.Build())); }
public IActionResult Pull() { var response = new PullResponseBuilder(this.Session.GetUser()); var organisation = new Organisations(this.Session).FindBy(M.Organisation.Owner, this.Session.GetUser()); response.AddObject("root", organisation, M.Organisation.AngularEmployees); return(this.Ok(response.Build())); }
public ActionResult Pull() { var response = new PullResponseBuilder(this.AllorsUser); var organisation = new Organisations(this.AllorsSession).FindBy(M.Organisation.Owner, this.AllorsUser); response.AddObject("root", organisation, M.Organisation.AngularShareholders); return(this.JsonSuccess(response.Build())); }
public async Task <IActionResult> Pull() { var response = new PullResponseBuilder(this.Session.GetUser()); var people = new People(this.Session).Extent().ToArray(); response.AddCollection("people", people); return(this.Ok(response.Build())); }
public ActionResult Pull() { var response = new PullResponseBuilder(this.AllorsUser); response.AddObject("object", this.AllorsUser); response.AddCollection("collection", new Organisations(this.AllorsSession).Extent()); return(this.JsonSuccess(response.Build())); }
public IActionResult Pull() { var acls = new WorkspaceAccessControlLists(this.Session.GetUser()); var response = new PullResponseBuilder(acls, this.TreeService); response.AddObject("object", acls.User); response.AddCollection("collection", new Organisations(this.Session).Extent()); return(this.Ok(response.Build())); }
public async Task <IActionResult> Pull() { var acls = new WorkspaceAccessControlLists(this.Session.GetUser()); var response = new PullResponseBuilder(acls, this.TreeService); var people = new People(this.Session).Extent().ToArray(); response.AddCollection("people", people); return(this.Ok(response.Build())); }
public IActionResult Pull() { var acls = new WorkspaceAccessControlLists(this.Session.GetUser()); var response = new PullResponseBuilder(acls, this.TreeService); var organisation = new Organisations(this.Session).FindBy(M.Organisation.Owner, this.Session.GetUser()); response.AddObject("root", organisation, M.Organisation.AngularShareholders); return(this.Ok(response.Build())); }
public IActionResult Pull() { var user = this.Session.GetUser(); var response = new PullResponseBuilder(user); response.AddObject("object", user); response.AddCollection("collection", new Organisations(this.Session).Extent()); return(this.Ok(response.Build())); }
public ActionResult Pull(string id) { var response = new PullResponseBuilder(this.AllorsUser); var person = this.AllorsSession.Instantiate(id); response.AddObject("person", person, tree); return(this.JsonSuccess(response.Build())); }
public IActionResult Pull([FromBody] Model model) { var response = new PullResponseBuilder(this.allors.Session.GetUser()); var person = this.allors.Session.Instantiate(model.Id); response.AddObject("person", person); return(this.Ok(response.Build())); }
public ActionResult Pull() { var reponse = new PullResponseBuilder(this.AllorsUser); var people = new People(this.AllorsSession).Extent(); reponse.AddCollection("people", people); return(this.JsonSuccess(reponse.Build())); }
public ActionResult Pull() { var response = new PullResponseBuilder(this.AllorsUser); var organisations = new Organisations(this.AllorsSession).Extent(); response.AddCollection("organisations", organisations); return(this.JsonSuccess(response.Build())); }
public IActionResult Pull([FromBody] Model model) { var acls = new WorkspaceAccessControlLists(this.allors.Session.GetUser()); var response = new PullResponseBuilder(acls, this.TreeService); var person = this.allors.Session.Instantiate(model.Id); response.AddObject("person", person); return(this.Ok(response.Build())); }
public ActionResult Pull() { try { var response = new PullResponseBuilder(this.AllorsUser); return(this.JsonSuccess(response.Build())); } catch (Exception e) { return(this.JsonError(e.Message)); } }
public ActionResult Pull(string criteria) { var response = new PullResponseBuilder(this.AllorsUser); var persons = new People(this.AllorsSession).Extent(); persons.Filter.AddLike(M.Person.UserName.RoleType, criteria + "%"); response.AddCollection("results", persons.Take(100)); return(this.JsonSuccess(response.Build())); }
public ActionResult Pull(string id) { var response = new PullResponseBuilder(this.AllorsUser); var organisation = this.AllorsSession.Instantiate(id); response.AddObject("organisation", organisation, Tree); response.AddCollection("people", new People(this.AllorsSession).Extent(), PeopleTree); return(this.JsonSuccess(response.Build())); }
public async Task <IActionResult> Pull([FromBody] TestUnitSamplesParams @params) { try { var unitSample = new UnitSamples(this.Session).Extent().First; if (unitSample == null) { unitSample = new UnitSampleBuilder(this.Session).Build(); this.Session.Commit(); } var acls = new WorkspaceAccessControlLists(this.Session.GetUser()); var responseBuilder = new PullResponseBuilder(acls, this.TreeService); switch (@params.Step) { case 0: unitSample.RemoveAllorsBinary(); unitSample.RemoveAllorsBoolean(); unitSample.RemoveAllorsDateTime(); unitSample.RemoveAllorsDecimal(); unitSample.RemoveAllorsDouble(); unitSample.RemoveAllorsInteger(); unitSample.RemoveAllorsString(); unitSample.RemoveAllorsUnique(); break; case 1: unitSample.AllorsBinary = new byte[] { 1, 2, 3 }; unitSample.AllorsBoolean = true; unitSample.AllorsDateTime = new DateTime(1973, 3, 27, 0, 0, 0, DateTimeKind.Utc); unitSample.AllorsDecimal = 12.34m; unitSample.AllorsDouble = 123d; unitSample.AllorsInteger = 1000; unitSample.AllorsString = "a string"; unitSample.AllorsUnique = new Guid("2946CF37-71BE-4681-8FE6-D0024D59BEFF"); break; } this.Session.Commit(); responseBuilder.AddObject("unitSample", unitSample); var pullResponse = responseBuilder.Build(); return(this.Ok(pullResponse)); } catch (Exception e) { return(this.BadRequest(e.Message)); } }
public IActionResult Pull() { try { var response = new PullResponseBuilder(this.Session.GetUser()); return(this.Ok(response.Build())); } catch (Exception e) { return(this.BadRequest(e.Message)); } }
public IActionResult Pull() { try { var acls = new WorkspaceAccessControlLists(this.Session.GetUser()); var response = new PullResponseBuilder(acls, this.TreeService); return(this.Ok(response.Build())); } catch (Exception e) { return(this.BadRequest(e.Message)); } }
public ActionResult Pull(int step) { try { var unitSample = new UnitSamples(this.AllorsSession).Extent().First; if (unitSample == null) { unitSample = new UnitSampleBuilder(this.AllorsSession).Build(); this.AllorsSession.Commit(); } var responseBuilder = new PullResponseBuilder(this.AllorsUser); switch (step) { case 0: unitSample.RemoveAllorsBinary(); unitSample.RemoveAllorsBoolean(); unitSample.RemoveAllorsDateTime(); unitSample.RemoveAllorsDecimal(); unitSample.RemoveAllorsDouble(); unitSample.RemoveAllorsInteger(); unitSample.RemoveAllorsString(); unitSample.RemoveAllorsUnique(); break; case 1: unitSample.AllorsBinary = new byte[] { 1, 2, 3 }; unitSample.AllorsBoolean = true; unitSample.AllorsDateTime = new DateTime(1973, 3, 27, 0, 0, 0, DateTimeKind.Utc); unitSample.AllorsDecimal = 12.34m; unitSample.AllorsDouble = 123d; unitSample.AllorsInteger = 1000; unitSample.AllorsString = "a string"; unitSample.AllorsUnique = new Guid("2946CF37-71BE-4681-8FE6-D0024D59BEFF"); break; } this.AllorsSession.Commit(); responseBuilder.AddObject("unitSample", unitSample); return(this.JsonSuccess(responseBuilder.Build())); } catch (Exception e) { return(this.JsonError(e.Message)); } }
public ActionResult Pull(string existingCallId) { var response = new PullResponseBuilder(this.AllorsUser); var me = (Person)this.AllorsUser; response.AddObject("me", me, M.Person.MainTree); var existingCall = this.AllorsSession.Instantiate(existingCallId); response.AddObject("existingCall", existingCall, M.Call.MainTree); return(this.JsonSuccess(response.Build())); }
public IActionResult Pull() { try { var response = new PullResponseBuilder(this.Session.GetUser()); var organisation = new Organisations(this.Session).FindBy(M.Organisation.Owner, this.Session.GetUser()); response.AddObject("root", organisation, M.Organisation.AngularShareholders); return(this.Ok(response.Build())); } catch (Exception e) { return(this.BadRequest(e.Message)); } }
public ActionResult Pull() { var user = (Person)this.allors.Session.GetUser(); var responseBuilder = new PullResponseBuilder(user, this.treeService); var userTree = new Node[] { new Node(M.Person.Addresses), }; responseBuilder.AddObject("user", user, userTree); return(this.Ok(responseBuilder.Build())); }
public ActionResult Pull(string criteria) { var response = new PullResponseBuilder(this.AllorsUser); var people = new People(this.AllorsSession).Extent(); var or = people.Filter.AddOr(); or.AddLike(M.Person.LastName, criteria + "%"); or.AddLike(M.Person.FirstName, criteria + "%"); response.AddCollection("results", people.Take(100)); return(this.JsonSuccess(response.Build())); }
public JsonResult Pull() { var response = new PullResponseBuilder(this.AllorsUser); var me = (Person)this.AllorsUser; response.AddObject("me", me, M.Person.AppHomeTree); var onlinePeople = new People(this.AllorsSession).Extent(); onlinePeople.Filter.AddEquals(M.Person.IsOnline, true); response.AddCollection("onlinePeople", onlinePeople); return(this.JsonSuccess(response.Build())); }
public IActionResult Pull([FromBody] PullRequest req) { try { return(this.PolicyService.InvokePolicy.Execute( () => { using (var session = this.DatabaseService.Database.CreateSession()) { var user = session.GetUser(); var response = new PullResponseBuilder(user); if (req.P != null) { foreach (var p in req.P) { var pull = p.Load(session); if (pull.Object != null) { var pullInstantiate = new PullInstantiate(session, pull, user, this.FetchService); pullInstantiate.Execute(response); } else { var pullExtent = new PullExtent(session, pull, user, this.ExtentService, this.FetchService); pullExtent.Execute(response); } } } return this.Ok(response.Build()); } })); } catch (Exception e) { this.Logger.LogError(e, "Exception"); return(this.StatusCode(500, e.Message)); } }
public ActionResult <PullResponse> Post([FromBody] PullRequest request) => this.PolicyService.InvokePolicy.Execute( () => { try { using (var session = this.DatabaseService.Database.CreateSession()) { var acls = new WorkspaceAccessControlLists(session.GetUser()); var response = new PullResponseBuilder(acls, this.TreeService); if (request.p != null) { foreach (var p in request.p) { var pull = p.Load(session); if (pull.Object != null) { var pullInstantiate = new PullInstantiate(session, pull, acls, this.FetchService); pullInstantiate.Execute(response); } else { var pullExtent = new PullExtent(session, pull, acls, this.ExtentService, this.FetchService); pullExtent.Execute(response); } } } return(response.Build()); } } catch (Exception e) { this.Logger.LogError(e, "PullRequest {request}", request); throw; } });
public Task <PullResponse> Pull(PullRequest request) { try { using (var session = this.Database.CreateSession()) { var acls = new WorkspaceAccessControlLists(session.GetUser()); var response = new PullResponseBuilder(acls, this.TreeService); if (request.P != null) { foreach (var p in request.P) { var pull = p.Load(session); if (pull.Object != null) { var pullInstantiate = new PullInstantiate(session, pull, acls, this.FetchService); pullInstantiate.Execute(response); } else { var pullExtent = new PullExtent(session, pull, acls, this.ExtentService, this.FetchService); pullExtent.Execute(response); } } } return(Task.FromResult(response.Build())); } } catch (Exception e) { this.Logger.LogError(e, "PullRequest {request}", request); throw; } }