Exemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.add_farmer);
            EditText email = FindViewById <EditText>(Resource.Id.editText1);
            EditText rid   = FindViewById <EditText>(Resource.Id.editText2);

            net.azurewebsites.agc20171.AISCM agc = new net.azurewebsites.agc20171.AISCM();
            agc.adduser(email.Text, "2", rid.Text);
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.monitorstatus);
            net.azurewebsites.agc20171.AISCM aiscm = new net.azurewebsites.agc20171.AISCM();
            MainActivity g = new MainActivity();

            TextView temp = FindViewById <TextView>(Resource.Id.textView3);
            TextView mois = FindViewById <TextView>(Resource.Id.textView4);
        }
Exemplo n.º 3
0
        public async void OnConnected(Bundle connectionHint)
        {
            //Successful log in hooray!!
            mSignInClicked = false;

            if (mInfoPopulated)
            {
                //No need to populate info again
                return;
            }

            if (PlusClass.PeopleApi.GetCurrentPerson(mGoogleApiClient) != null)
            {
                IPerson plusUser = PlusClass.PeopleApi.GetCurrentPerson(mGoogleApiClient);
                var     email    = PlusClass.AccountApi.GetAccountName(mGoogleApiClient);
                net.azurewebsites.agc20171.AISCM agc = new net.azurewebsites.agc20171.AISCM();
                string name   = plusUser.DisplayName.ToString();
                string gender = "";
                switch (plusUser.Gender)
                {
                case 0:
                    gender += "Male";
                    break;

                case 1:
                    gender += "Female";
                    break;

                case 2:
                    gender += "Other";
                    break;

                default:
                    gender += "Unknown";
                    break;
                }

                int c = agc.signup(email, name, gender, user_type.ToString());
                Global_portable.email = user_email;
                if (user_type == 2)
                {
                    StartActivity(typeof(register_farmer));
                }
                else
                {
                    StartActivity(typeof(register_manu_company));
                }
                mInfoPopulated = true;
            }
        }
Exemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            string region = "";

            SetContentView(Resource.Layout.register_manu_company);
            Button      add     = FindViewById <Button>(Resource.Id.button1);
            EditText    name    = FindViewById <EditText>(Resource.Id.editText1);
            EditText    address = FindViewById <EditText>(Resource.Id.editText2);
            EditText    cnum    = FindViewById <EditText>(Resource.Id.editText3);
            RadioGroup  rgdid   = FindViewById <RadioGroup>(Resource.Id.radioGroup1);
            RadioButton did     = FindViewById <RadioButton>(rgdid.CheckedRadioButtonId);

            region = did.Text;
            net.azurewebsites.agc20171.AISCM a = new net.azurewebsites.agc20171.AISCM();
            Button add_details = FindViewById <Button>(Resource.Id.button1);

            add_details.Click += delegate
            {
                a.add_manufacturing_company_details(Global_portable.email, address.Text, cnum.Text, name.Text, region);
                StartActivity(typeof(Login));
            };
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.register_farmer);
            phval = FindViewById <TextView>(Resource.Id.textView2);
            Button add = FindViewById <Button>(Resource.Id.button1);

            add.Click += delegate
            {
                EditText address    = FindViewById <EditText>(Resource.Id.editText1);
                EditText cnum       = FindViewById <EditText>(Resource.Id.editText2);
                EditText raspi_name = FindViewById <EditText>(Resource.Id.editText11);
                SeekBar  ph         = FindViewById <SeekBar>(Resource.Id.seekBar1);
                ph.SetOnSeekBarChangeListener(this);
                RadioGroup  dg       = FindViewById <RadioGroup>(Resource.Id.radioGroup1);
                RadioButton rb       = FindViewById <RadioButton>(dg.CheckedRadioButtonId);
                string      district = rb.Text;
                EditText    height   = FindViewById <EditText>(Resource.Id.editText1);
                net.azurewebsites.agc20171.AISCM a = new net.azurewebsites.agc20171.AISCM();
                a.add_farmer_details(Global_portable.email, address.Text, cnum.Text, phval.Text, district, height.Text);
                StartActivity(typeof(Login));
            };
        }
Exemplo n.º 6
0
        public async void OnConnected(Bundle connectionHint)
        {
            //Successful log in hooray!!
            mSignInClicked = false;

            if (mInfoPopulated)
            {
                //No need to populate info again
                return;
            }

            if (PlusClass.PeopleApi.GetCurrentPerson(mGoogleApiClient) != null)
            {
                IPerson plusUser = PlusClass.PeopleApi.GetCurrentPerson(mGoogleApiClient);
                var     email    = PlusClass.AccountApi.GetAccountName(mGoogleApiClient);
                net.azurewebsites.agc20171.AISCM agc = new net.azurewebsites.agc20171.AISCM();
                int      id = Convert.ToInt32(agc.signin(email));
                MainPage mp = new MainPage();
                mp.user_type = id.ToString();
                mp.email     = email;
                Global.email = email;
                MainActivity ma = new MainActivity();
                ma.email             += email;
                Global.login          = 1;
                Global_portable.email = email;
                user_email            = email;
                switch (id)
                {
                case -1:
                    string name   = plusUser.DisplayName.ToString();;
                    string gender = "";
                    switch (plusUser.Gender)
                    {
                    case 0:
                        gender += "Male";
                        break;

                    case 1:
                        gender += "Female";
                        break;

                    case 2:
                        gender += "Other";
                        break;

                    default:
                        gender += "Unknown";
                        break;
                    }
                    agc.signup(mp.email, name, gender);
                    break;

                case 0:
                    Toast.MakeText(this, "INVALID USER!!!", ToastLength.Long).Show();
                    break;

                case 1:
                    Toast.MakeText(this, "Authenticated", ToastLength.Long);


                    break;

                case 2:
                    //StartActivity(typeof(farmer_home));
                    StartActivity(typeof(MainActivity));
                    //await Xamarin.Forms.Application.Current.MainPage.Navigation.PushModalAsync(new MainPage());
                    break;
                }
                string location = plusUser.CurrentLocation;

                /* if (plusUser.HasDisplayName)
                 * {
                 *   mName.Text += plusUser.DisplayName;
                 * }
                 *
                 * if (plusUser.HasTagline)
                 * {
                 *   mTagline.Text += plusUser.Tagline;
                 * }
                 *
                 * if (plusUser.HasBraggingRights)
                 * {
                 *   mBraggingRights.Text += plusUser.BraggingRights;
                 *
                 * }
                 * mEmail.Text += email;
                 * if(plusUser.HasImage)
                 * {
                 *   ImageView im = FindViewById<ImageView>(Resource.Id.imageView1);
                 *
                 * }
                 * if(plusUser.HasBirthday)
                 * {
                 *   mBraggingRights.Text += plusUser.Birthday;
                 * }
                 *
                 * if (plusUser.HasRelationshipStatus)
                 * {
                 *   switch (plusUser.RelationshipStatus)
                 *   {
                 *       case 0:
                 *           mRelationship.Text += "Single";
                 *           break;
                 *
                 *       case 1:
                 *           mRelationship.Text += "In a relationship";
                 *           break;
                 *
                 *       case 2:
                 *           mRelationship.Text += "Engaged";
                 *           break;
                 *
                 *       case 3:
                 *           mRelationship.Text += "Married";
                 *           break;
                 *
                 *       case 4:
                 *           mRelationship.Text += "It's complicated";
                 *           break;
                 *
                 *       case 5:
                 *           mRelationship.Text += "In an open relationship";
                 *           break;
                 *
                 *       case 6:
                 *           mRelationship.Text += "Widowed";
                 *           break;
                 *
                 *       case 7:
                 *           mRelationship.Text += "In a domestic partnership";
                 *           break;
                 *
                 *       case 8:
                 *           mRelationship.Text += "In a civil union";
                 *           break;
                 *
                 *       default:
                 *           mRelationship.Text += "Unknown";
                 *           break;
                 *   }
                 * }
                 *
                 * if (plusUser.HasGender)
                 * {
                 *   switch (plusUser.Gender)
                 *   {
                 *       case 0:
                 *           mGender.Text += "Male";
                 *           break;
                 *
                 *       case 1:
                 *           mGender.Text += "Female";
                 *           break;
                 *
                 *       case 2:
                 *           mGender.Text += "Other";
                 *           break;
                 *
                 *       default:
                 *           mGender.Text += "Unknown";
                 *           break;
                 *   }
                 * }*/

                mInfoPopulated = true;
            }
        }
Exemplo n.º 7
0
 void SendRegistrationToAppServer(string token)
 {
     // Add custom implementation here as needed
     net.azurewebsites.agc20171.AISCM a = new net.azurewebsites.agc20171.AISCM();
     a.update_gcm_token(Global_portable.email, token);
 }