private async Task Button_OnClicked(object sender, EventArgs e)
        {
            var datamanager  = new DataLayerManager();
            var personResult = datamanager.GetPersonInformation(_person.Username);

            if (personResult.IsSuccess)
            {
                var result = datamanager.SavePersonSite(new PersonSite
                {
                    PersonId            = personResult.Value.Id,
                    Email               = Email.Text.Trim(),
                    Password            = Password.Text.Trim(),
                    Phone               = Phone.Text.Trim(),
                    Url                 = Url.Text.Trim(),
                    Username            = Username.Text.Trim(),
                    WebName             = WebName.Text.Trim(),
                    BackgroundColorSite = ColorPicker.Items[ColorPicker.SelectedIndex]
                });

                if (result.IsSuccess)
                {
                    var answer = await DisplayAlert("Success", "WebSite Kayıt Edildi", "Tamam", "Cancel");

                    if (answer)
                    {
                        Application.Current.MainPage = new NavigationPage(new HomePage(_person));
                    }
                }
            }
        }
Пример #2
0
        private void AddNewWebsite(object obj)
        {
            var personResult = dataLayerManager.GetPersonInformation(_person.Username);

            if (personResult.IsSuccess)
            {
                Navigation.PushAsync(new DetailPage(personResult.Value));
            }
        }
Пример #3
0
        private void OnLoginButtonClicked(object sender, EventArgs e)
        {
            var result = _dataLayerManager.Login(new Person
            {
                Username = Username.Text,
                Password = Password.Text
            });

            if (result.IsSuccess)
            {
                var getPersonInformation = _dataLayerManager.GetPersonInformation(Username.Text.Trim());
                Application.Current.MainPage = new NavigationPage(new HomePage(getPersonInformation.Value));
            }
            else
            {
                DisplayAlert("Error", result.Message, "OK", "Cancel");
            }
        }