public async void validar(string email, string password, string device) { var ServiceClient = new SALLab08.ServiceClient(); var resultado = await ServiceClient.ValidateAsync(email, password, device); tvName.Text = resultado.Fullname; tvStatus.Text = resultado.Status.ToString(); tvToken.Text = resultado.Token; }
public async void Validate(string device, string correo, string contrasena) { var UserNameValue = FindViewById <TextView>(Resource.Id.UserNameValue); var StatusValue = FindViewById <TextView>(Resource.Id.StatusValue); var TokenValue = FindViewById <TextView>(Resource.Id.TokenValue); var ServiceClient = new SALLab08.ServiceClient(); var SvcResult = await ServiceClient.ValidateAsync( correo, contrasena, device); StatusValue.Text = $"{SvcResult.Status}"; UserNameValue.Text = $"{SvcResult.Fullname}"; TokenValue.Text = $"{SvcResult.Token}"; }
protected async override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); var NameUserView = FindViewById <TextView>(Resource.Id.ResultUserName); var StatusView = FindViewById <TextView>(Resource.Id.ResultStatus); var CodeView = FindViewById <TextView>(Resource.Id.ResultCode); var ServiceClient = new SALLab08.ServiceClient(); string myDevice = Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId); var Result = await ServiceClient.ValidateAsync("*****@*****.**", "PassWrod", myDevice); NameUserView.Text = Result.Fullname.ToString(); StatusView.Text = Result.Status.ToString(); CodeView.Text = Result.Token.ToString(); }
async Task Validate() { SALLab08.ServiceClient ServiceClient = new SALLab08.ServiceClient(); string StudentMail = "*****@*****.**"; string Password = "******"; string myDevice = Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId); var Result = await ServiceClient.ValidateAsync(StudentMail, Password, myDevice); var UserNameResultTextView = FindViewById <TextView>(Resource.Id.UserNameResultTextView); var StatusResultTextView = FindViewById <TextView>(Resource.Id.StatusResultTextView); var TokenResultTextView = FindViewById <TextView>(Resource.Id.TokenResultTextView); UserNameResultTextView.Text = Result.Fullname; StatusResultTextView.Text = Result.Status.ToString(); TokenResultTextView.Text = Result.Token; }
private async Task ValidateActivityAsync() { SALLab08.ServiceClient client = new SALLab08.ServiceClient(); var response = await client.ValidateAsync("*****@*****.**", "PizsToTheWorld", Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId)); var txtStatus = FindViewById <TextView>(Resource.Id.StatusValue); txtStatus.Text = response.Status.ToString(); var txtName = FindViewById <TextView>(Resource.Id.UserNameValue); txtName.Text = response.Fullname; var txtToken = FindViewById <TextView>(Resource.Id.TokenValue); txtToken.Text = response.Token; }
private async void ValidateJC() { string StudentEmail = @"*****@*****.**"; string PasswordStudent = "******"; ///comentado 2018 string myDevice = Android.Provider.Settings.Secure.GetString( ContentResolver, Android.Provider.Settings.Secure.AndroidId); var userNameEdit = FindViewById <EditText>(Resource.Id.userNameEditText); var statusEdit = FindViewById <EditText>(Resource.Id.statusEditText); var tokenEdit = FindViewById <EditText>(Resource.Id.tokenEditText); var ServiceClient = new SALLab08.ServiceClient(); var Result = await ServiceClient.ValidateAsync(StudentEmail, PasswordStudent, myDevice); userNameEdit.Text = $"{Result.Fullname}"; statusEdit.Text = $"{Result.Status}"; tokenEdit.Text = $"{Result.Token}"; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); //var ViewGroup = (Android.Views.ViewGroup) // Window.DecorView.FindViewById(Android.Resource.Id.Content); //var MainLayout = ViewGroup.GetChildAt(0) as LinearLayout; //var HeaderImage = new ImageView(this); //HeaderImage.SetImageResource(Resource.Drawable.xamarin_diplomado_30); //MainLayout.AddView(HeaderImage); //var UserNameTextView = new TextView(this); //UserNameTextView.Text = GetString(Resource.String.UserName); //MainLayout.AddView(UserNameTextView); string EMail = ""; string Password = ""; string Device = Android.Provider.Settings.Secure.GetString( ContentResolver, Android.Provider.Settings.Secure.AndroidId); var UserNameResTextView = FindViewById <TextView>(Resource.Id.UserNameResTextView); var StatusResTextView = FindViewById <TextView>(Resource.Id.StatusResTextView); var TokenResTextView = FindViewById <TextView>(Resource.Id.TokenResTextView); Validate(); async void Validate() { var ServiceClient = new SALLab08.ServiceClient(); var SvcResult = await ServiceClient.ValidateAsync(EMail, Password, Device); UserNameResTextView.Text = SvcResult.Fullname; StatusResTextView.Text = SvcResult.Status.ToString(); TokenResTextView.Text = SvcResult.Token; Result = $"{SvcResult.Status}\n{SvcResult.Fullname}\n{SvcResult.Token}"; } }
private async void ValidarActividad() { try { SALLab08.ServiceClient client = new SALLab08.ServiceClient(); SALLab08.ResultInfo result = await client.ValidateAsync("", "", Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId)); RunOnUiThread(() => { FindViewById <TextView>(Resource.Id.UserNameValue).Text = result.Fullname; FindViewById <TextView>(Resource.Id.StatusValue).Text = Enum.GetName(typeof(SALLab08.Status), result.Status); FindViewById <TextView>(Resource.Id.TokenValue).Text = result.Token; }); } catch (Exception ex) { Toast.MakeText(this, $"Error: {ex.Message}", ToastLength.Long).Show(); } }
private async void Validate() { var ServiceClient = new SALLab08.ServiceClient(); var textViewUsuario = FindViewById <TextView>(Resource.Id.textVUsuario); var textViewStatus = FindViewById <TextView>(Resource.Id.textVStatusR); var textViewToken = FindViewById <TextView>(Resource.Id.textVTokenR); string myDevice = Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId); string StudentEmail = "*****@*****.**"; string Password = "******"; var Result = await ServiceClient.ValidateAsync(StudentEmail, Password, myDevice); try { textViewUsuario.Text = $"{Result.Fullname}"; textViewStatus.Text = $"{Result.Status}"; textViewToken.Text = $"{Result.Token}"; } catch { } }