POS_Sprint_3 #5

Merged
s426229 merged 10 commits from POS_Sprint_3 into develop 2020-12-30 17:30:24 +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!";
}
}
}
}