protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Lmenu); connect data = new connect(); userAccount account = new userAccount(); date_type Date = new date_type(); var welcome = FindViewById <TextView>(Resource.Id.txtwelcome); var date = FindViewById <TextView>(Resource.Id.txtdate); var glb = FindViewById <Button>(Resource.Id.btnglb); date.Text = Date.datetext; if (data.internet == true) { welcome.Text = "Welcome " + account.username; } else { welcome.Text = "You're in offline mode"; } }
private void Signup_Click(object sender, System.EventArgs e) { SetContentView(Resource.Layout.Lsignup); connect data = new connect(); var inuser = FindViewById <EditText>(Resource.Id.inUsername); var inpass = FindViewById <EditText>(Resource.Id.inPass); var inemail = FindViewById <EditText>(Resource.Id.inEmail); var signup = FindViewById <Button>(Resource.Id.btnSign); signup.Click += (s, e) => { if (inuser.Text != null && inpass.Text != null && inemail.Text != null) { var check = data.client.Get("Account/" + inuser.Text); userAccount Caccount = check.ResultAs <userAccount>(); if (Caccount.username != inuser.Text && Caccount.email != inemail.Text) { userAccount account = new userAccount() { username = inuser.Text, email = inemail.Text, password = inpass.Text }; var setter = data.client.Set("Account/" + inuser.Text, account); SetContentView(Resource.Layout.Llogin); } } else { } }; }