public void Edit()
        {
            var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");

            var people = new People(this.Session).Extent();
            var person = people.First(v => v.PartyName.Equals("John0 Doe0"));

            var editPartyRelationship = new CustomerRelationshipBuilder(this.Session)
                                        .WithCustomer(person)
                                        .WithInternalOrganisation(allors)
                                        .Build();

            this.Session.Derive();
            this.Session.Commit();

            var before = new PartyRelationships(this.Session).Extent().ToArray();

            var personOverview = this.personListPage.Select(person);

            var page = personOverview.SelectPartyRelationship(editPartyRelationship);

            page.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22))
            .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1))
            .Save.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new PartyRelationships(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, this.editPartyRelationship.FromDate.Date.ToUniversalTime().Date);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, this.editPartyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date);
        }
예제 #2
0
        public ActionResult List()
        {
            var orgs = Organisations.Get();

            ViewBag.Orgs = orgs;
            return(View());
        }
        public PersonPhoneCommunicationEditTest(TestFixture fixture)
            : base(fixture)
        {
            var people = new People(this.Session).Extent();
            var person = people.First(v => v.PartyName.Equals("Jane0 Doe0"));

            var allors        = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");
            var firstEmployee = allors.ActiveEmployees.First(v => v.FirstName.Equals("first"));

            this.editCommunicationEvent = new PhoneCommunicationBuilder(this.Session)
                                          .WithSubject("dummy")
                                          .WithLeftVoiceMail(true)
                                          .WithFromParty(person)
                                          .WithToParty(firstEmployee)
                                          .WithPhoneNumber(person.GeneralPhoneNumber)
                                          .Build();

            this.anotherPhoneNumber = new PartyContactMechanismBuilder(this.Session)
                                      .WithContactMechanism(new TelecommunicationsNumberBuilder(this.Session).WithCountryCode("+1").WithAreaCode("111").WithContactNumber("222").Build())
                                      .WithContactPurpose(new ContactMechanismPurposes(this.Session).SalesOffice)
                                      .WithUseAsDefault(false)
                                      .Build();

            person.AddPartyContactMechanism(this.anotherPhoneNumber);

            this.Session.Derive();
            this.Session.Commit();

            var dashboard = this.Login();

            this.people = dashboard.Sidenav.NavigateToPersonList();
        }
예제 #4
0
        public Organisations Insert(Organisations org)
        {
            var organisation = unitOfWork.OrganisationRepository.Insert(org);

            unitOfWork.Save();
            return(organisation);
        }
        public void IndexerForOrganisationsWithItems()
        {
            var systemUnderTest = new Settings();
            var organisation    = new Organisations();

            for (var counter = 0; counter < 4; counter++)
            {
                var entityRef = new EntityReference($"TestEntity{counter}", Guid.NewGuid());
                var mapping   = new Item <EntityReference, EntityReference>(entityRef, entityRef);
                organisation.Mappings.Add(mapping);
            }

            systemUnderTest.Organisations.Add(new KeyValuePair <Guid, Organisations>(Guid.NewGuid(), new Organisations()
            {
            }));
            systemUnderTest.Organisations.Add(new KeyValuePair <Guid, Organisations>(organisation.Mappings[1].Key.Id, organisation));
            systemUnderTest.Organisations.Add(new KeyValuePair <Guid, Organisations>(Guid.NewGuid(), new Organisations()
            {
            }));

            var actual = systemUnderTest[organisation.Mappings[1].Key.Id.ToString()];

            actual.Entities.Count.Should().Be(0);
            actual.Mappings.Count.Should().Be(organisation.Mappings.Count);
            actual.Sortcolumns.Count.Should().Be(0);
        }
        public void Create()
        {
            var before = new PartyRelationships(this.Session).Extent().ToArray();

            var extent = new Organisations(this.Session).Extent();
            var internalOrganisation = extent.First(v => v.PartyName.Equals("Allors BVBA"));

            var organisationOverviewPage = this.organisations.Select(internalOrganisation);
            var page = organisationOverviewPage.NewCustomerRelationship();

            page.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22))
            .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1))
            .Save.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new PartyRelationships(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var partyRelationship = after.Except(before).First();

            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, partyRelationship.FromDate.Date.ToUniversalTime().Date);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, partyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date);
        }
예제 #7
0
        public void Default()
        {
            var existingOrganisation = new OrganisationBuilder(this.Session).WithName("existing organisation").Build();

            this.Session.Derive();
            this.Session.Commit();

            var sessions = new ISession[] { this.Session };

            foreach (var session in sessions)
            {
                session.Commit();

                var cachedOrganisation = new Organisations(session).Cache[existingOrganisation.UniqueId];
                Assert.Equal(existingOrganisation.UniqueId, cachedOrganisation.UniqueId);
                Assert.Same(session, cachedOrganisation.Strategy.Session);

                var newOrganisation = new OrganisationBuilder(session).WithName("new organisation").Build();
                cachedOrganisation = new Organisations(session).Cache[newOrganisation.UniqueId];
                Assert.Equal(newOrganisation.UniqueId, cachedOrganisation.UniqueId);
                Assert.Same(session, cachedOrganisation.Strategy.Session);

                session.Rollback();
            }
        }
        public HttpResponseMessage Post(Organisations o)
        {
            ClaimsPrincipal p = RequestContext.Principal as ClaimsPrincipal;

            OrganisationsDA.ChangePassword(o.Password, o.Login);
            return(new HttpResponseMessage(HttpStatusCode.OK));
        }
예제 #9
0
        public void CreateMinimal()
        {
            var before = new Organisations(this.Session).Extent().ToArray();

            var expected = new OrganisationBuilder(this.Session).WithDefaults().Build();

            this.Session.Derive();

            var expectedName = expected.Name;

            var organisationCreate = this.organisationListPage
                                     .CreateOrganisation()
                                     .Build(expected, true);

            this.Session.Rollback();
            organisationCreate.SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new Organisations(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var actual = after.Except(before).First();

            Assert.Equal(expectedName, actual.Name);
            Assert.False(actual.ExistTaxNumber);
            Assert.False(actual.ExistLegalForm);
            Assert.False(actual.ExistLocale);
            Assert.False(actual.ExistIndustryClassifications);
            Assert.False(actual.ExistIndustryClassifications);
            Assert.False(actual.IsManufacturer);
            Assert.False(actual.ExistComment);
        }
예제 #10
0
        public IHttpActionResult AssignUsers(Guid id, OrganisationAssignmentDTO model)
        {
            if (id == Guid.Empty)
            {
                return(BadRequest("id is empty"));
            }

            var org = Organisations.Find(id);

            if (org == null)
            {
                return(NotFound());
            }

            var subscriptionService = new SubscriptionService(UnitOfWork);

            subscriptionService.MoveUsersToOrganisation(org, model.OrgUsers);

            try
            {
                // TODO: notify the user by email.
                // notify orgUser about joining organisation
                // notify orgAdmin about new user

                UnitOfWork.Save();
                MemoryCacher.DeleteStartingWith(CACHE_KEY);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
예제 #11
0
        // DEL api/organisations/{id}
        public IHttpActionResult Delete(Guid id)
        {
            if (id == Guid.Empty)
            {
                return(BadRequest("id is empty"));
            }

            try
            {
                Organisations.Delete(id);
                UnitOfWork.Save();

                MemoryCacher.DeleteStartingWith(CACHE_KEY);

                return(Ok());
            }
            catch (DbUpdateException)
            {
                return(BadRequest("this organisation cannot be deleted"));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
예제 #12
0
        // POST api/organisations
        public IHttpActionResult Post([FromBody] OrganisationDTO value)
        {
            var createOrganisation = new CreateOrganisation();

            createOrganisation.Name                = value.Name;
            createOrganisation.RootUserEmail       = value.RootUser.Email;
            createOrganisation.RootUserFirstName   = value.RootUser.FirstName;
            createOrganisation.RootUserSurname     = value.RootUser.Surname;
            createOrganisation.RootPassword        = value.RootUser.Password;
            createOrganisation.RootConfirmPassword = value.RootUser.ConfirmPassword;
            createOrganisation.AddressLine1        = value.AddressLine1;
            createOrganisation.AddressLine2        = value.AddressLine2;
            createOrganisation.County              = value.County;
            createOrganisation.Town                = value.Town;
            createOrganisation.Postcode            = value.Postcode;
            createOrganisation.TelNumber           = value.TelNumber;
            createOrganisation.DefaultCalendarId   = CalendarsRepository.Gregorian.Id;
            createOrganisation.DefaultLanguageId   = LanguagesRepository.English.Id;

            Organisations.CreateOrganisation(createOrganisation);

            try
            {
                UnitOfWork.Save();
                MemoryCacher.DeleteStartingWith(CACHE_KEY);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
        public void Create()
        {
            var before = new Employments(this.Session).Extent().ToArray();

            var employer = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");

            this.people.Table.DefaultAction(this.employee);
            var employmentEditComponent = new PersonOverviewComponent(this.people.Driver).PartyrelationshipOverviewPanel.Click().CreateEmployment();

            employmentEditComponent.FromDate
            .Set(DateTimeFactory.CreateDate(2018, 12, 22))
            .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1))
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new Employments(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var partyRelationship = after.Except(before).First();

            // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, partyRelationship.FromDate.Date.ToUniversalTime().Date);
            // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, partyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date);
            Assert.Equal(employer, partyRelationship.Employer);
            Assert.Equal(this.employee, partyRelationship.Employee);
        }
        public OrganisationPhoneCommunicationCreateTest(TestFixture fixture)
            : base(fixture)
        {
            var organisation = new Organisations(this.Session).Extent().First;

            var allors        = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");
            var firstEmployee = allors.ActiveEmployees.First();

            this.editCommunicationEvent = new PhoneCommunicationBuilder(this.Session)
                                          .WithSubject("dummy")
                                          .WithLeftVoiceMail(true)
                                          .WithFromParty(firstEmployee)
                                          .WithToParty(organisation.CurrentContacts.First)
                                          .WithPhoneNumber(organisation.GeneralPhoneNumber)
                                          .Build();

            this.organisationPhoneNumber = new PartyContactMechanismBuilder(this.Session)
                                           .WithContactMechanism(new TelecommunicationsNumberBuilder(this.Session).WithCountryCode("+1").WithAreaCode("111").WithContactNumber("222").Build())
                                           .WithContactPurpose(new ContactMechanismPurposes(this.Session).SalesOffice)
                                           .WithUseAsDefault(false)
                                           .Build();

            organisation.AddPartyContactMechanism(this.organisationPhoneNumber);

            this.Session.Derive();
            this.Session.Commit();

            this.Login();
            this.organisations = this.Sidenav.NavigateToOrganisations();
        }
예제 #15
0
        public PersonEmploymentEditTest(TestFixture fixture)
            : base(fixture)
        {
            var allors = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");

            this.employee = new PersonBuilder(this.Session).WithLastName("employee").Build();

            // Delete all existing for the new one to be in the first page of the list.
            foreach (PartyRelationship partyRelationship in allors.PartyRelationshipsWhereParty)
            {
                partyRelationship.Delete();
            }

            this.editPartyRelationship = new EmploymentBuilder(this.Session)
                                         .WithEmployee(this.employee)
                                         .WithEmployer(allors)
                                         .Build();

            this.Session.Derive();
            this.Session.Commit();

            var dashboard = this.Login();

            this.people = dashboard.Sidenav.NavigateToPersonList();
        }
        public static int UpdateOrganisationDatabase(int rID, int oID, int old_oID)
        {
            Registers                r  = GetRegister(rID);
            Organisations            o  = OrganisationDA.GetOrganisation(oID);
            Organisations            o2 = OrganisationDA.GetOrganisation(old_oID);
            ConnectionStringSettings connectionstring = Database.CreateConnectionString("System.Data.SqlClient", "JUSTIJN\\SQLEXPRESS", o.DbName, o.DbLogin, o.DbPassword);
            string      sql         = "INSERT INTO Register VALUES (@RegisterName, @Device)";
            DbParameter par1        = Database.AddParameter(CON, "@RegisterName", r.RegisterName);
            DbParameter par2        = Database.AddParameter(CON, "@Device", r.Device);
            int         ValidUpdate = Database.InsertData(Database.GetConnection(connectionstring), sql, par1, par2);
            int         ValidUpdate2;

            if (old_oID > 0)
            {
                ConnectionStringSettings connectionstring2 = Database.CreateConnectionString("System.Data.SqlClient", "JUSTIJN\\SQLEXPRESS", o2.DbName, o2.DbLogin, o2.DbPassword);
                string      sql2 = "DELETE FROM Register WHERE RegisterName=@RegisterName";
                DbParameter par3 = Database.AddParameter(CON, "@RegisterName", r.RegisterName);
                ValidUpdate2 = Database.ModifyData(Database.GetConnection(connectionstring2), sql2, par3);
            }
            else
            {
                ValidUpdate2 = 1;
            }


            if (ValidUpdate > 0 & ValidUpdate2 > 0)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
예제 #17
0
        public async Task <ActionResult> GetOneOrganisation(Organisations organisations, string command = "", string modalCommand = "")
        {
            if (command.Equals("Save"))
            {
                if (ModelState.IsValid)
                {
                    Context.Entry(organisations).State = EntityState.Modified;
                    await Context.SaveChangesAsync();

                    ViewBag.Title = organisations.Name;
                }
                return(View(organisations));
            }
            else if (command.Equals("Exit"))
            {
                return(RedirectToAction("GetAllOrganisations"));
            }

            if (command.Equals("Delete") || modalCommand.ToUpper().Equals("OK"))
            {
                DeleteOrganisation(organisations);
            }
            if (modalCommand.ToUpper().Equals("CANCEL"))
            {
                return(RedirectToAction("GetOneOrganisation", new { id = organisations.Id }));
            }

            return(RedirectToAction("GetAllOrganisations"));
        }
예제 #18
0
        public void Edit()
        {
            var before = new PartyRelationships(this.Session).Extent().ToArray();

            var extent = new Organisations(this.Session).Extent();
            var internalOrganisation = extent.First(v => v.DisplayName().Equals("Allors BVBA"));

            this.organisations.Table.DefaultAction(internalOrganisation);
            var organisationOverviewPage = new OrganisationOverviewComponent(this.organisations.Driver);

            var partyRelationshipOverview = organisationOverviewPage.PartyrelationshipOverviewPanel.Click();

            partyRelationshipOverview.Table.DefaultAction(this.editPartyRelationship);

            var partyRelationshipEdit = new SupplierRelationshipEditComponent(organisationOverviewPage.Driver);

            partyRelationshipEdit
            .FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22))
            .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1))
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new PartyRelationships(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, this.editPartyRelationship.FromDate.Date.ToUniversalTime().Date);
            // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, this.editPartyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date);
        }
        public void SetListViewSortingWithSettingsContainsOrganisationIdAndListItemValueIsEqualToInputColumnAndSortOrderDescending()
        {
            using (var listview = new System.Windows.Forms.ListView())
            {
                int column = 1;
                var inputOrganisationId = Guid.NewGuid();
                listview.Name    = inputOrganisationId.ToString();
                listview.Sorting = System.Windows.Forms.SortOrder.Descending;

                var settings = new Settings();

                var org      = new Organisations();
                var listItem = new Item <string, int>(inputOrganisationId.ToString(), 1);
                org.Sortcolumns.Add(listItem);

                var item = new KeyValuePair <Guid, Organisations>(inputOrganisationId, org);
                settings.Organisations.Add(item);

                FluentActions.Invoking(() => systemUnderTest.SetListViewSorting(listview, column, inputOrganisationId.ToString(), settings))
                .Should()
                .NotThrow();

                listview.ListViewItemSorter.Should().NotBeNull();
                listview.Sorting.Should().Be(System.Windows.Forms.SortOrder.Ascending);
            }
        }
예제 #20
0
        public void Edit()
        {
            var before = new Employments(this.Session).Extent().ToArray();

            var employer = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");

            var personOverviewPage = this.people.Select(this.employee);
            var page = personOverviewPage.SelectPartyRelationship(this.editPartyRelationship);

            page.FromDate.Set(DateTimeFactory.CreateDate(2018, 12, 22))
            .ThroughDate.Set(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1))
            .Save.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new Employments(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, this.editPartyRelationship.FromDate.Date.ToUniversalTime().Date);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).AddYears(1).Date, this.editPartyRelationship.ThroughDate.Value.Date.ToUniversalTime().Date);
            Assert.Equal(employer, this.editPartyRelationship.Employer);
            Assert.Equal(this.employee, this.editPartyRelationship.Employee);
        }
예제 #21
0
        public IHttpActionResult Get(Guid id)
        {
            if (id == Guid.Empty)
            {
                return(Ok(Mapper.Map <OrganisationDTO>(new Organisation())));
            }

            var cacheKey   = $"{CACHE_KEY}_{id}";
            var cacheEntry = MemoryCacher.GetValue(cacheKey);

            if (cacheEntry == null)
            {
                var organisation = Organisations.Find(id);
                if (organisation == null)
                {
                    return(NotFound());
                }

                var result = Mapper.Map <OrganisationDTO>(organisation);
                MemoryCacher.Add(cacheKey, result, DateTimeOffset.UtcNow.AddMinutes(1));

                return(Ok(result));
            }
            else
            {
                var result = (OrganisationDTO)cacheEntry;
                return(new CachedResult <OrganisationDTO>(result, TimeSpan.FromMinutes(1), this));
            }
        }
예제 #22
0
        public JsonResult EditOrganisation(EditOrganisationVm model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    //convert model to ef model
                    Organisations eForganisation = organisationService.GetById(model.Id);
                    eForganisation.Name        = model.Name;
                    eForganisation.Email       = model.Email;
                    eForganisation.Phone       = model.Phone;
                    eForganisation.Website     = model.Website;
                    eForganisation.Address1    = model.Address1;
                    eForganisation.Address2    = model.Address2;
                    eForganisation.Address3    = model.Phone;
                    eForganisation.City        = model.City;
                    eForganisation.County      = model.County;
                    eForganisation.Postcode    = model.Postcode;
                    eForganisation.Country     = model.Country;
                    eForganisation.Description = model.Description;
                    organisationService.Update(eForganisation);

                    return(Json(new { status = CommonConstants.Ok, message = CommonConstants.Ok }));
                }
                catch (Exception e)
                {
                    return(Json(new { status = CommonConstants.Error, message = CommonConstants.SomethingWentWrong }));
                }
            }
            else
            {
                return(Json(new { status = CommonConstants.Error, message = CommonConstants.FailedValidation }));
            }
        }
예제 #23
0
        public void Create()
        {
            var allors   = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");
            var employee = allors.ActiveEmployees.First();

            var organisation = allors.ActiveCustomers.First(v => v.GetType().Name == typeof(Organisation).Name);

            var organisationAddress = new PostalAddressBuilder(this.Session)
                                      .WithAddress1("Haverwerf 15")
                                      .WithLocality("city")
                                      .WithPostalCode("1111")
                                      .WithCountry(new Countries(this.Session).FindBy(M.Country.IsoCode, "BE"))
                                      .Build();

            organisation.AddPartyContactMechanism(new PartyContactMechanismBuilder(this.Session).WithContactMechanism(organisationAddress).Build());

            this.Session.Derive();
            this.Session.Commit();

            var before = new LetterCorrespondences(this.Session).Extent().ToArray();

            this.organisationListPage.Table.DefaultAction(organisation);
            var letterCorrespondenceEdit = new OrganisationOverviewComponent(this.organisationListPage.Driver).CommunicationeventOverviewPanel.Click().CreateLetterCorrespondence();

            letterCorrespondenceEdit
            .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed)
            .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Appointment)
            .FromParty.Select(organisation)
            .ToParty.Select(employee)
            .FromPostalAddress.Select(organisationAddress)
            .Subject.Set("subject");
            letterCorrespondenceEdit.ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22));
            letterCorrespondenceEdit.ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22));
            letterCorrespondenceEdit.ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23));
            letterCorrespondenceEdit.ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23));
            letterCorrespondenceEdit.Comment.Set("comment");
            letterCorrespondenceEdit.SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new LetterCorrespondences(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var communicationEvent = after.Except(before).First();

            Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState);
            Assert.Contains(new CommunicationEventPurposes(this.Session).Appointment, communicationEvent.EventPurposes);
            Assert.Equal(organisationAddress, communicationEvent.PostalAddress);
            Assert.Equal(organisation, communicationEvent.FromParty);
            Assert.Equal(employee, communicationEvent.ToParty);
            Assert.Equal("subject", communicationEvent.Subject);
            Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date);
            Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date);
            Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date);
            Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date);
            Assert.Equal("comment", communicationEvent.Comment);
        }
        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()));
        }
예제 #25
0
        public async Task <ActionResult> GetOneOrganisation(int id)
        {
            Organisations content = await Task.Run(() => Context.Organisations.Where(x => x.Id == id).ToList()[0]);

            ViewBag.Title = content.Name;

            return(View(content));
        }
예제 #26
0
        public void Title()
        {
            var organisation = new Organisations(this.Session).FindBy(M.Organisation.Name, "Acme0");

            this.organisationListPage.Select(organisation);

            Assert.Equal("Organisation", this.Driver.Title);
        }
예제 #27
0
        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()));
        }
예제 #28
0
        public async Task <IActionResult> Pull()
        {
            var response = new PullResponseBuilder(this.Session.GetUser());
            var people   = new Organisations(this.Session).Extent().ToArray();

            response.AddCollection("organisations", people, true);
            return(this.Ok(response.Build()));
        }
예제 #29
0
        public void OrganisationsInstantiation()
        {
            var systemUnderTest = new Organisations();

            systemUnderTest.Sortcolumns.Count.Should().Be(0);
            systemUnderTest.Mappings.Count.Should().Be(0);
            systemUnderTest.Entities.Count.Should().Be(0);
        }
예제 #30
0
        public void Table()
        {
            var organisation = new Organisations(this.Session).FindBy(M.Organisation.Name, "Acme0");
            var row          = this.page.Table.FindRow(organisation);
            var cell         = row.FindCell("name");

            Assert.Equal("Acme0", cell.Element.Text);
        }
예제 #31
0
파일: CacheTest.cs 프로젝트: whesius/allors
        public void Default()
        {
            var existingOrganisation = new OrganisationBuilder(this.Session).WithName("existing organisation").Build();

            this.Session.Derive(true);
            this.Session.Commit();

            var sessions = new ISession[] { this.Session };
            foreach (var session in sessions)
            {
                session.Commit();

                var cachedOrganisation = new Organisations(session).Cache.Get(existingOrganisation.UniqueId);
                Assert.AreEqual(existingOrganisation.UniqueId, cachedOrganisation.UniqueId);
                Assert.AreSame(session, cachedOrganisation.Strategy.Session);

                var newOrganisation = new OrganisationBuilder(session).WithName("new organisation").Build();
                cachedOrganisation = new Organisations(session).Cache.Get(newOrganisation.UniqueId);
                Assert.AreEqual(newOrganisation.UniqueId, cachedOrganisation.UniqueId);
                Assert.AreSame(session, cachedOrganisation.Strategy.Session);

                session.Rollback();
            }
        }