develop #10
@ -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!";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user