Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var response = client.RegisterUser(
                client.ClientIdentifier,
                client.ClientSecret,
                true,
                "*****@*****.**",
                "d8Ce#2f3Db",
                1111,
                "Test",
                "User",
                "Des Moines",
                "IA",
                "11111",
                8001234567,
                new DateTime(1990, 6, 1),
                "111 Test St. NW",
                "Ste 510",
                AccountInformationType.COMMERCIAL,
                "Test Company",
                12345);
            var table = WebUIUtility.BuildFieldDescTable(
                new Tuple <string, string>[] {
                Tuple.Create("Id", response.Id),
                Tuple.Create("Name", response.Name),
                Tuple.Create("Latitude", response.Latitude.ToString()),
                Tuple.Create("Longitude", response.Longitude.ToString()),
                Tuple.Create("Type", response.Type.ToString()),
                Tuple.Create("City", response.City),
                Tuple.Create("State", response.State)
            });

            this.regHolder.Controls.Add(table);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var nearby = client.Nearby(client.ClientIdentifier, client.ClientSecret, new Decimal(41.58454600), new Decimal(-93.63416700));

            if (!nearby.Any())
            {
                var l = new Label();
                l.Text = "No spots found.";
                this.nearbyHolder.Controls.Add(l);
            }
            else
            {
                foreach (NearbyResult spot in nearby)
                {
                    var table = WebUIUtility.BuildFieldDescTable(
                        new Tuple <string, string>[] {
                        Tuple.Create("Id", spot.Id),
                        Tuple.Create("Name", spot.Name),
                        Tuple.Create("Latitude", spot.Latitude.ToString()),
                        Tuple.Create("Longitude", spot.Longitude.ToString()),
                        Tuple.Create("Address", spot.Address),
                        Tuple.Create("City", spot.City),
                        Tuple.Create("State", spot.State),
                        Tuple.Create("PostalCode", spot.PostalCode),
                        Tuple.Create("Group", string.Join(",", spot.Group)),
                        Tuple.Create("Image", spot.Image)
                    }
                        );

                    this.nearbyHolder.Controls.Add(table);
                    this.nearbyHolder.Controls.Add(WebUIUtility.HorizontalLine());
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            IAuthorizationState authorization = client.ProcessUserAuthorization();

            if (authorization == null)
            {
                client.RequestUserAuthorization(new Scope[] { Scope.TRANSACTIONS });
            }
            else
            {
                var transactionstat = client.TransactionsStats(
                    authorization.AccessToken,
                    new TransactionStatsType[] { TransactionStatsType.TRANSACTIONSCOUNT, TransactionStatsType.TRANSACTIONSTOTAL },
                    new DateTime(2011, 6, 1),
                    new DateTime(2011, 6, 15));

                if (transactionstat == null)
                {
                    var l = new Label();
                    l.Text = "No transaction stat found";
                    this.transactionstatHolder.Controls.Add(l);
                }
                else
                {
                    var table = WebUIUtility.BuildFieldDescTable(
                        new Tuple <string, string>[] {
                        Tuple.Create("TransactionsCount", transactionstat.TransactionsCount.ToString()),
                        Tuple.Create("TransactionsTotal", transactionstat.TransactionsTotal.ToString()),
                    });

                    this.transactionstatHolder.Controls.Add(table);
                    this.transactionstatHolder.Controls.Add(WebUIUtility.HorizontalLine());
                }
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IAuthorizationState authorization = client.ProcessUserAuthorization();

            if (authorization == null)
            {
                client.RequestUserAuthorization(new Scope[] { Scope.ACCOUNTINFOFULL });
            }
            else
            {
                var accountInfo = client.AccountInformation(authorization.AccessToken);
                var table       = WebUIUtility.BuildFieldDescTable(
                    new Tuple <string, string>[] {
                    Tuple.Create("Id", accountInfo.Id),
                    Tuple.Create("Name", accountInfo.Name),
                    Tuple.Create("Latitude", accountInfo.Latitude.ToString()),
                    Tuple.Create("Longitude", accountInfo.Longitude.ToString()),
                    Tuple.Create("Type", accountInfo.Type.Value),
                    Tuple.Create("City", accountInfo.City),
                    Tuple.Create("State", accountInfo.State),
                }
                    );

                this.accountInfoHolder.Controls.Add(table);
                this.accountInfoHolder.Controls.Add(WebUIUtility.HorizontalLine());
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var accountInfo = client.BasicInformation(client.ClientIdentifier, client.ClientSecret, "812-602-4485");
            var table       = WebUIUtility.BuildFieldDescTable(
                new Tuple <string, string>[] {
                Tuple.Create("Id", accountInfo.Id),
                Tuple.Create("Name", accountInfo.Name),
                Tuple.Create("Latitude", accountInfo.Latitude.ToString()),
                Tuple.Create("Longitude", accountInfo.Longitude.ToString()),
            }
                );

            this.accountInfoHolder.Controls.Add(table);
            this.accountInfoHolder.Controls.Add(WebUIUtility.HorizontalLine());
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            IAuthorizationState authorization = client.ProcessUserAuthorization();

            if (authorization == null)
            {
                client.RequestUserAuthorization(new Scope[] { Scope.TRANSACTIONS });
            }
            else
            {
                var transactions = client.TransactionsListing(authorization.AccessToken);

                if (!transactions.Any())
                {
                    var l = new Label();
                    l.Text = "No transactions found";
                    this.transactionsHolder.Controls.Add(l);
                }
                else
                {
                    foreach (TransactionsResult transaction in transactions)
                    {
                        var table = WebUIUtility.BuildFieldDescTable(
                            new Tuple <string, string>[] {
                            Tuple.Create("Id", transaction.Id),
                            Tuple.Create("Date", transaction.Date.ToString()),
                            Tuple.Create("Amount", transaction.Amount.ToString()),
                            Tuple.Create("DestinationId", transaction.DestinationId),
                            Tuple.Create("DestinationName", transaction.DestinationName),
                            Tuple.Create("SourceId", transaction.SourceId),
                            Tuple.Create("SourceName", transaction.SourceName),
                            Tuple.Create("SourceType", transaction.Type.Value),
                            Tuple.Create("UserType", transaction.UserType.Value),
                            Tuple.Create("Status", transaction.Status.Value),
                            Tuple.Create("ClearingDate", transaction.ClearingDate.ToString()),
                        }
                            );

                        this.transactionsHolder.Controls.Add(table);
                        this.transactionsHolder.Controls.Add(WebUIUtility.HorizontalLine());
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            IAuthorizationState authorization = client.ProcessUserAuthorization();

            if (authorization == null)
            {
                client.RequestUserAuthorization(new Scope[] { Scope.CONTACTS });
            }
            else
            {
                var contacts = client.Contacts(authorization.AccessToken);

                if (!contacts.Any())
                {
                    var l = new Label();
                    l.Text = "No contacts found.";
                    this.contactsHolder.Controls.Add(l);
                }
                else
                {
                    foreach (ContactsResult contact in contacts)
                    {
                        var table = WebUIUtility.BuildFieldDescTable(
                            new Tuple <string, string>[] {
                            Tuple.Create("Id", contact.Id),
                            Tuple.Create("Name", contact.Name),
                            Tuple.Create("Image", contact.Image),
                            Tuple.Create("Type", contact.Type.Value),
                        }
                            );

                        this.contactsHolder.Controls.Add(table);
                        this.contactsHolder.Controls.Add(WebUIUtility.HorizontalLine());
                    }
                }
            }
        }