protected virtual void OnPropertiesClicked(object sender, System.EventArgs e)
	{
		object cur = addressview.GetCurrentObject();
		if (cur == null)
			return;
		if (cur is Address) {
			na = (Address) cur;
			NewAddress dlg = new NewAddress (na);
			dlg.Run();
			dlg = null;
		}
		else {
			ng = (AddressGroup) cur;
			NewGroup dlg = new NewGroup (ng);
			dlg.Run();
			dlg = null;
		}
	} 
Exemple #2
0
        public async Task <ActionResult> CustomerMove(int key, [SingleParameterBinder(typeof(NewAddress))] NewAddress newAddress)
        {
            if (newAddress == null)
            {
                return(this.Problem(ProblemJsonBuilder.CreateBadParameters()));
            }

            try
            {
                var customer = await customerRepository.GetEnitityByKeyAsync(key);

                var hypermediaCustomer = new HypermediaCustomer(customer);
                hypermediaCustomer.MoveAction.Execute(newAddress);
                return(Ok());
            }
            catch (EntityNotFoundException)
            {
                return(this.Problem(ProblemJsonBuilder.CreateEntityNotFound()));
            }
            catch (CanNotExecuteActionException)
            {
                return(this.CanNotExecute());
            }
            catch (ActionParameterValidationException e)
            {
                var problem = new ProblemJson()
                {
                    Title       = $"Can not use provided object of type '{typeof(NewAddress)}'",
                    Detail      = e.Message,
                    ProblemType = "WebApiHypermediaExtensionsCore.Hypermedia.BadActionParameter",
                    StatusCode  = 422 // Unprocessable Entity
                };
                return(this.UnprocessableEntity(problem));
            }
        }
        public async Task Add(NewAddress address)
        {
            address.UserId = _currentUser.Id;
            await _db.Addresses.Add(address);

            await _db.SaveChanges();
        }
Exemple #4
0
        public IActionResult ValidateAddress(NewAddress newAddress)
        {
            int?session_id = HttpContext.Session.GetInt32("id");

            if (ModelState.IsValid)
            {
                Addresses address = new Addresses
                {
                    address_line_one  = newAddress.address_line_one,
                    address_line_two  = newAddress.address_line_two,
                    city              = newAddress.city,
                    state_or_province = newAddress.state_or_province,
                    zip_or_postal     = newAddress.zip_or_postal,
                    country           = newAddress.country,
                    created_at        = DateTime.Now,
                    updated_at        = DateTime.Now,
                    user_id           = (int)session_id,
                };

                _context.Add(address);
                _context.SaveChanges();
                return(RedirectToAction("AddressView"));
            }
            return(View("NewAddress", newAddress));
        }
        public void CustomerAddress(int i)
        {
            string      fileName         = ConfigReader.TestDataFilepath;
            ExcelHelper eat              = new ExcelHelper(fileName);
            string      strWorksheetName = eat.getExcelSheetName(fileName, 2);
            Actions     action           = new Actions(DriverContext.GetDriver <IWebDriver>());

            action.MoveToElement(CustomerDetails).Build().Perform();
            action.MoveToElement(Address).Build().Perform();
            Address.Click();
            NewAddress.Click();
            TextBoxHelper.TypeInTextBox(AddressTextBox, eat.GetCellData("Address", "AddressTextBox", i));
            TextBoxHelper.TypeInTextBox(Address_City, eat.GetCellData("Address", "Address_city", i));

            ComboBoxHelper.SelectElementByText(Address_Region, eat.GetCellData("Address", "Address_Region", i));

            TextBoxHelper.TypeInTextBox(Address_PostalCode, eat.GetCellData("Address", "Address_PostalCode", i));

            Address_AddressType_Main.Click();

            Address_AddressType_Registered.Click();

            Address_AddressType_Correspondence.Click();

            Save.Click();
        }
	protected virtual void OnNewaddressClicked(object sender, System.EventArgs e)
	{
		na = new Address();
		NewAddress dlg = new NewAddress (na);
		dlg.Run();
		list.Add (na);
		dlg = null;
	}
        public Task <Address> ProvisionNewAddressAsync(string currencySymbol)
        {
            var newAddress = new NewAddress
            {
                CurrencySymbol = currencySymbol
            };

            return(_restClient.GetResponseAsync <Address>("addresses", HttpMethod.Post, true, newAddress));
        }
Exemple #8
0
        public async Task <Address> CreateAsync(NewAddress address)
        {
            Requires.ArgumentNotNull(address, nameof(address));

            var addresses = await GetAsync(new AddressRequest { PageSize = 1 }).ConfigureAwait(_halClient);

            return(await _halClient.PostAsync <Address>(addresses.CreateAddressLink, address)
                   .ConfigureAwait(_halClient));
        }
Exemple #9
0
    protected virtual void OnNewaddressClicked(object sender, System.EventArgs e)
    {
        na = new Address();
        NewAddress dlg = new NewAddress(na);

        dlg.Run();
        list.Add(na);
        dlg = null;
    }
        public async Task Should_be_able_to_update_representative_participant()
        {
            var editPrefix    = " _Edit";
            var seededHearing = await Hooks.SeedVideoHearing();

            var beforeUpdatedDate = seededHearing.UpdatedDate;

            TestContext.WriteLine($"New seeded video hearing id: {seededHearing.Id}");
            _newHearingId = seededHearing.Id;
            var representativeParticipant = seededHearing.GetParticipants().FirstOrDefault(x => x.HearingRole.UserRole.Name.Equals("Representative"));

            var        title            = representativeParticipant.Person.Title + editPrefix;
            var        displayName      = representativeParticipant.DisplayName + editPrefix;
            var        telephoneNumber  = "11112222333";
            var        houseNumber      = "HouseNumber" + editPrefix;
            var        street           = "Street" + editPrefix;
            var        postcode         = "ED1 5NR";
            var        city             = "City" + editPrefix;
            var        county           = "County" + editPrefix;
            var        organisationName = "Organisation" + editPrefix;
            NewAddress address          = new NewAddress()
            {
                HouseNumber = houseNumber,
                Street      = street,
                City        = city,
                County      = county,
                Postcode    = postcode
            };
            const string reference            = "Marvel Comics Division";
            var          representee          = "Iron Man Inc.";
            RepresentativeInformation repInfo = new RepresentativeInformation()
            {
                Reference   = reference,
                Representee = representee
            };
            var updateParticipantCommand = new UpdateParticipantCommand(representativeParticipant.Id, title, displayName, telephoneNumber, address, organisationName, seededHearing, repInfo);
            await _commandHandler.Handle(updateParticipantCommand);

            var updatedRepresentative = (Representative)updateParticipantCommand.UpdatedParticipant;

            updatedRepresentative.Should().NotBeNull();
            updatedRepresentative.UpdatedDate.Should().BeAfter(beforeUpdatedDate);
            updatedRepresentative.Person.Title.Should().Be(title);
            updatedRepresentative.DisplayName.Should().Be(displayName);
            updatedRepresentative.Person.TelephoneNumber.Should().Be(telephoneNumber);
            updatedRepresentative.Person.Address.Should().BeNull();
            updatedRepresentative.Person.Organisation.Should().NotBeNull();
            updatedRepresentative.Person.Organisation.Name.Should().Be(organisationName);
            updatedRepresentative.Reference.Should().Be(repInfo.Reference);
            updatedRepresentative.Representee.Should().Be(repInfo.Representee);
        }
        public byte[] GetBytesCemi()
        {
            TunnelCemiRequest builder = new TunnelCemiRequest();

            List <byte> data = new List <byte>();

            data.AddRange(Serial);

            data.AddRange(NewAddress.GetBytes());
            data.AddRange(new byte[] { 0, 0, 0, 0 });

            builder.Build(UnicastAddress.FromString("0.0.0"), MulticastAddress.FromString("0/0/0"), ApciTypes.IndividualAddressSerialNumberWrite, 255, data.ToArray());
            builder.SetPriority(Prios.System);
            return(builder.GetBytes());
        }
Exemple #12
0
 public IActionResult ValidateEdit(int id, NewAddress edit)
 {
     if (ModelState.IsValid)
     {
         Addresses current_address = _context.addresses.SingleOrDefault(a => a.address_id == id);
         {
             current_address.address_line_one  = edit.address_line_one;
             current_address.address_line_two  = edit.address_line_two;
             current_address.city              = edit.city;
             current_address.state_or_province = edit.state_or_province;
             current_address.zip_or_postal     = edit.zip_or_postal;
             current_address.country           = edit.country;
             current_address.updated_at        = DateTime.Now;
             _context.SaveChanges();
         };
         return(RedirectToAction("AddressView"));
     }
     return(View("EditAddress", edit));
 }
        public async Task Should_be_able_to_update_individual_participant()
        {
            var editPrefix    = " _Edit";
            var seededHearing = await Hooks.SeedVideoHearing();

            var beforeUpdatedDate = seededHearing.UpdatedDate;

            TestContext.WriteLine($"New seeded video hearing id: {seededHearing.Id}");
            _newHearingId = seededHearing.Id;
            var individualParticipant = seededHearing.GetParticipants().SingleOrDefault(x => x.HearingRole.UserRole.Name.Equals("Individual"));

            var        title            = individualParticipant.Person.Title + editPrefix;
            var        displayName      = individualParticipant.DisplayName + editPrefix;
            var        telephoneNumber  = "11112222333";
            var        houseNumber      = individualParticipant.Person.Address?.HouseNumber + editPrefix;
            var        street           = individualParticipant.Person.Address?.Street + editPrefix;
            var        postcode         = individualParticipant.Person.Address?.Postcode + editPrefix;
            var        city             = "City" + editPrefix;
            var        county           = "County" + editPrefix;
            var        organisationName = "Organisation" + editPrefix;
            NewAddress address          = new NewAddress()
            {
                HouseNumber = houseNumber,
                Street      = street,
                City        = city,
                County      = county,
                Postcode    = postcode
            };

            var updateParticipantCommand = new UpdateParticipantCommand(individualParticipant.Id, title, displayName, telephoneNumber, address, organisationName, seededHearing, null);
            await _commandHandler.Handle(updateParticipantCommand);

            var updatedIndividual = (Individual)updateParticipantCommand.UpdatedParticipant;

            updatedIndividual.Should().NotBeNull();
            updatedIndividual.UpdatedDate.Should().BeAfter(beforeUpdatedDate);
            updatedIndividual.Person.Title.Should().Be(title);
            updatedIndividual.DisplayName.Should().Be(displayName);
            updatedIndividual.Person.TelephoneNumber.Should().Be(telephoneNumber);
            updatedIndividual.Person.Address.HouseNumber.Should().Be(houseNumber);
            updatedIndividual.Person.Address.Street.Should().Be(street);
            updatedIndividual.Person.Address.Postcode.Should().Be(postcode);
        }
Exemple #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Write("Hi! got lat lon?");

        NewAddress ad = new NewAddress();

        NewAddress.Lat = 3.3;
        NewAddress.Lon = 4.4;
        Console.WriteLine(NewAddress.Lat);
        Console.WriteLine(NewAddress.Lon);

        if (IsPost)
        {
            double latloc = Request["lati"];
            double lonloc = Request["loni"];
            Response.Write("Hi! got lat lon? " + latloc + " and " + lonloc);
        }
        else
        {
            Response.Write("Post method error ");
        }
    }
Exemple #15
0
    protected virtual void OnPropertiesClicked(object sender, System.EventArgs e)
    {
        object cur = addressview.GetCurrentObject();

        if (cur == null)
        {
            return;
        }
        if (cur is Address)
        {
            na = (Address)cur;
            NewAddress dlg = new NewAddress(na);
            dlg.Run();
            dlg = null;
        }
        else
        {
            ng = (AddressGroup)cur;
            NewGroup dlg = new NewGroup(ng);
            dlg.Run();
            dlg = null;
        }
    }
Exemple #16
0
 public Task Add(NewAddress address)
 {
     return(_set.AddAsync(_mapper.Map <Address>(address)));
 }
 public Task Add([FromBody] NewAddress address)
 {
     return(_addresses.Add(address));
 }