Esempio n. 1
0
        public AddressSearch(int type, Tuple <NamedValue, NamedValue, NamedValue> selected)
        {
            InitializeComponent();
            this.Type      = type;
            BindingContext = viewModel = new AddressSearchViewModel(selected);
            switch (type)
            {
            case 1: StreetStack.IsVisible = false;
                //HouseStack.IsVisible = false;
                FlatStack.IsVisible = false;
                break;

            case 2:
                //HouseStack.IsVisible = false;
                FlatStack.IsVisible = false;
                break;
            }


            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                int statusBarHeight = DependencyService.Get <IStatusBar>().GetHeight();
                Pancake2.HeightRequest = statusBarHeight;
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        public JsonResult GetAddresses(AddressSearchViewModel addressSearchViewModel)
        {
            IEnumerable <AddressModel> models = searchManager.GetAddresses(
                addressSearchViewModel.PostCode,
                addressSearchViewModel.BuildingNumber);

            return(Json(models, JsonRequestBehavior.AllowGet));
        }
        public AddressSearchWindow()
        {
            InitializeComponent();

            _addressService = ServiceResolver.Get().Resolve <IAddressLookupService>();

            _viewModel = new AddressSearchViewModel
            {
                Addresses = new List <AddressFindResult.Address>()
            };

            DataContext = _viewModel;
        }
Esempio n. 4
0
        public ActionResult MultiCoinResults(string addresses)
        {
            List <string> validCoins = new List <string>();

            //List<string> knownCoins = BitcoinForks.ForkByShortName.Keys.ToList();
            using (CoinpanicContext db = new CoinpanicContext())
            {
                validCoins = db.IndexCoinInfo.AsNoTracking().Select(i => i.Coin).ToList();
            }
            AddressSearchViewModel viewModel = new AddressSearchViewModel()
            {
                Addresses = addresses.Replace("\r\n", ","),
                Coins     = validCoins,
            };

            return(View(viewModel));
        }
Esempio n. 5
0
        public async Task <IActionResult> CreditorPostcodeSave(AddressSearchViewModel model)
        {
            if (!ModelState.IsValid || !HttpContext.Session.Keys.Contains(_newCreditorId))
            {
                SetJourneyObject(model);
                SetAdHocCreditorNameToViewBag();
                var storedModel = GetJourneyObject <AddressSearchViewModel>(nameof(CreditorPostcode));
                model.Addresses = storedModel.Addresses;
                return(ContinueJourneyRedirect(nameof(CreditorPostcode), new { debtId = model.DebtId, hasError = true }));
            }

            var creditorId = new Guid(HttpContext.Session.GetString(_newCreditorId));
            var address    = await _addressLookupService.GetFullAddressAsync(model.SelectedAddress);

            await _integrationGateway.AddAdHocCreditorAddressAsync(address, creditorId);

            SetJourneyObject(model);

            return(ContinueJourneyRedirect(nameof(DebtSold), new { id = creditorId }));
        }