protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.HomeScreen);

			Button profile = FindViewById<Button> (Resource.Id.ProfileButton);


			var user= Intent.GetStringExtra("user");
			var key = Intent.GetStringExtra("key");
			Console.WriteLine (user + " @@@@@ " + key);

			LoginResponse data = new LoginResponse (user, key);
				
			profile.Click += async (sender, e) => {

				var Pgetter = new ProfileUtility();
				ProfileResponse result = await Pgetter.ProfileAsync(data);

				Intent intent = new Intent(this, typeof(StudentProfile));
				var b = new Bundle();
				b.PutString("fname",result.fname);
				b.PutString("lname",result.lname);
				b.PutString("major",result.major);
				b.PutString("email",result.email);
				b.PutString("gender",result.gender);
				b.PutString("year",result.year);
				b.PutString("age",result.age.ToString());
				intent.PutExtras(b);
				StartActivity(intent);
			};

			// Create your application here
		}
Exemple #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.HomeScreen);

            Button profile = FindViewById <Button> (Resource.Id.ProfileButton);


            var user = Intent.GetStringExtra("user");
            var key  = Intent.GetStringExtra("key");

            Console.WriteLine(user + " @@@@@ " + key);

            LoginResponse data = new LoginResponse(user, key);

            profile.Click += async(sender, e) => {
                var             Pgetter = new ProfileUtility();
                ProfileResponse result  = await Pgetter.ProfileAsync(data);

                Intent intent = new Intent(this, typeof(StudentProfile));
                var    b      = new Bundle();
                b.PutString("fname", result.fname);
                b.PutString("lname", result.lname);
                b.PutString("major", result.major);
                b.PutString("email", result.email);
                b.PutString("gender", result.gender);
                b.PutString("year", result.year);
                b.PutString("age", result.age.ToString());
                intent.PutExtras(b);
                StartActivity(intent);
            };

            // Create your application here
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.StudentProfile, container, false);
            var  user = Activity.Intent.GetStringExtra("user");
            var  key  = Activity.Intent.GetStringExtra("key");

            LoginResponse data    = new LoginResponse(user, key);
            var           Pgetter = new ProfileUtility();

            Task <ProfileResponse> result = Pgetter.ProfileAsync(data);

            var finishedResult = result.Result;

            TextView firstName = view.FindViewById <TextView> (Resource.Id.StudentFName);
            TextView lastName  = view.FindViewById <TextView> (Resource.Id.StudentLName);
            TextView email     = view.FindViewById <TextView> (Resource.Id.StudentEmail);
            TextView major     = view.FindViewById <TextView> (Resource.Id.StudentMajor);
            TextView gender    = view.FindViewById <TextView> (Resource.Id.StudentGender);
            TextView age       = view.FindViewById <TextView> (Resource.Id.StudentAge);
            TextView year      = view.FindViewById <TextView> (Resource.Id.StudentYear);

            var fName   = finishedResult.fname;
            var lName   = finishedResult.lname;
            var Smajor  = finishedResult.major;
            var Semail  = finishedResult.email;
            var Sgender = finishedResult.gender;
            var Syear   = finishedResult.year;
            var Sage    = finishedResult.age.ToString();

            firstName.Text = fName;
            lastName.Text  = lName;
            email.Text     = Semail;
            major.Text     = Smajor;
            gender.Text    = Sgender;
            year.Text      = Syear;
            age.Text       = Sage;

            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.StudentProfile, container, false);
            var user= Activity.Intent.GetStringExtra("user");
            var key = Activity.Intent.GetStringExtra("key");

            LoginResponse data = new LoginResponse (user, key);
            var Pgetter = new ProfileUtility();

            Task<ProfileResponse> result = Pgetter.ProfileAsync(data);

            var finishedResult = result.Result;

            TextView firstName = view.FindViewById<TextView> (Resource.Id.StudentFName);
            TextView lastName = view.FindViewById<TextView> (Resource.Id.StudentLName);
            TextView email = view.FindViewById<TextView> (Resource.Id.StudentEmail);
            TextView major = view.FindViewById<TextView> (Resource.Id.StudentMajor);
            TextView gender = view.FindViewById<TextView> (Resource.Id.StudentGender);
            TextView age = view.FindViewById<TextView> (Resource.Id.StudentAge);
            TextView year = view.FindViewById<TextView> (Resource.Id.StudentYear);

            var fName= finishedResult.fname;
            var lName = finishedResult.lname;
            var Smajor = finishedResult.major;
            var Semail = finishedResult.email;
            var Sgender = finishedResult.gender;
            var Syear = finishedResult.year;
            var Sage = finishedResult.age.ToString();

            firstName.Text = fName;
            lastName.Text = lName;
            email.Text = Semail;
            major.Text = Smajor;
            gender.Text = Sgender;
            year.Text = Syear;
            age.Text = Sage;

            return view;
        }