private void Btn_Entrar_Click(object sender, EventArgs e) { string LocalUsuario, LocalSenha, TipoUser; LocalUsuario = EdT_Usuario.Text; LocalSenha = EdT_Senha.Text; TipoUser = this.UserMngm.VerificaUsuario(this, LocalUsuario, LocalSenha); if (LocalUsuario == "" || LocalSenha == "") { Toast.MakeText(this, "Usuário Inválido ou senha invalido", ToastLength.Long).Show(); } else if (UserMngm.Logou(this, LocalUsuario, LocalSenha)) { if (TipoUser == "1") { UserLogado = new Intent(this, typeof(Main_Screen_User)); } else if (TipoUser == "2") { UserLogado = new Intent(this, typeof(Main_Screen_User)); } else if (TipoUser == "3") { UserLogado = new Intent(this, typeof(main_admin)); } else { Toast.MakeText(this, "Usuário ou senha Incorreto", ToastLength.Long).Show(); return; } UserLogado.PutExtra("Tela", UserMngm.VerUserLogado()); StartActivity(this.UserLogado); } }
protected override void OnCreate(Bundle savedInstanceState) { UsuarioClass UserMgnm = new UsuarioClass(); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main_usuario); BtnHorario = FindViewById <Button>(Resource.Id.Btn_VerHorarios); BtnVerMapas = FindViewById <Button>(Resource.Id.Btn_VerMapas); BtnConfig = FindViewById <Button>(Resource.Id.Btn_ConfgUser); TeV_NomeUser = FindViewById <TextView>(Resource.Id.TeV_UserName); cUser = Intent.GetStringExtra("Tela") ?? ""; TeV_NomeUser.Text = UserMgnm.VerUserLogado(); BtnHorario.Click += BtnHorario_Click; BtnVerMapas.Click += BtnVerMapas_Click; BtnConfig.Click += BtnConfig_Click; }