develop #10

Merged
s426229 merged 80 commits from develop into master 2021-01-27 18:32:19 +01:00
Showing only changes of commit 10cf3ca9c0 - Show all commits

View File

@ -66,7 +66,13 @@ namespace Klient.Droid
if (response.StatusCode == HttpStatusCode.OK)
{
savedLogin = Login;
var jsonString = await response.Content.ReadAsStringAsync();
dynamic jsonObject = JsonConvert.DeserializeObject(jsonString);
SetContentView(Resource.Layout.ekranPoLogowaniu);
savedName = jsonObject.user.name;
savedEmail = jsonObject.user.email;
savedSurname = jsonObject.user.surname;
}
}
@ -177,12 +183,18 @@ namespace Klient.Droid
var Surname = FindViewById<EditText>(Resource.Id.ChangeSurname).Text;
var Email = FindViewById<EditText>(Resource.Id.ChangeEmail).Text;
if (string.IsNullOrEmpty(Name) | string.IsNullOrEmpty(Email) | string.IsNullOrEmpty(Surname))
if (string.IsNullOrEmpty(Name))
{
FindViewById<TextView>(Resource.Id.NullValueProfile).Text = "Wartości nie mogą być puste!";
Name = savedName;
}
else
if (string.IsNullOrEmpty(Email))
{
Email = savedEmail;
}
if (string.IsNullOrEmpty(Surname))
{
Surname = savedSurname
}
var values = new Dictionary<string, string>
{
{ "email", Email },
@ -197,7 +209,7 @@ namespace Klient.Droid
var responseString = await response.Content.ReadAsStringAsync();
if (response.StatusCode == HttpStatusCode.OK) FindViewById<TextView>(Resource.Id.NullValueProfile).Text = "Zapisano!";
}
}
}
}