Esempio n. 1
0
 public void SetMemberActivity(string key, Member member)
 {
     if (!CommonService.CheckInternetConnection(this))
     {
         Toast.MakeText(this, "Please check your internet connection", ToastLength.Short).Show(); return;
     }
     if (key == "getbyemail")
     {
         if (member != null)
         {
             builder = new AlertDialog.Builder(this);
             builder.SetTitle("Something went wrong...");
             builder.SetMessage("Email already registered.");
             builder.SetPositiveButton("OK", OkCorrectAction);
             AlertDialog alert = builder.Create();
             alert.Show();
         }
         else
         {
             Service.MemberService backGroundTask = new Service.MemberService(this);
             backGroundTask.Execute("register", etName.Text, etPhone.Text, etEmail.Text, etCPassword.Text);
         }
     }
     if (key == "register")
     {
         Intent i = new Intent(this, typeof(ConfirmationActivity));
         i.PutExtra("memberEmail", etEmail.Text);
         i.PutExtra("memberPhone", etPhone.Text);
         this.StartActivityForResult(i, 1);
         //Finish();
     }
 }
Esempio n. 2
0
 private void BtnNext_Click(object sender, EventArgs e)
 {
     if (etCode.Text != "")
     {
         Service.MemberService backGroundTask = new Service.MemberService(this);
         backGroundTask.Execute("activateuser", email, etCode.Text);
         //backGroundTask = new Service.MemberService(this);
         //backGroundTask.Execute("getbyemail", mCurrentMember.member_email);
     }
     else if (etCode.Text == "")
     {
         builder = new AlertDialog.Builder(this);
         builder.SetTitle("Information");
         builder.SetMessage("Please fill the code.");
         builder.SetPositiveButton("OK", OkAction);
         AlertDialog alert = builder.Create();
         alert.Show();
     }
     else
     {
         builder = new AlertDialog.Builder(this);
         builder.SetTitle("Information");
         builder.SetMessage("Please fill correct code.");
         builder.SetPositiveButton("OK", OkAction);
         AlertDialog alert = builder.Create();
         alert.Show();
     }
 }
Esempio n. 3
0
 private void btnSignUp_Click(object sender, EventArgs e)
 {
     if (etName.Text.Equals("") ||
         etEmail.Text.Equals("") ||
         etPassword.Text.Equals("")
         )
     {
         builder = new AlertDialog.Builder(this);
         builder.SetTitle("Something went wrong...");
         builder.SetMessage("Fill all field...");
         builder.SetPositiveButton("OK", OkWrongAction);
         AlertDialog alert = builder.Create();
         alert.Show();
     }
     else if (!etPassword.Text.Equals(etCPassword.Text))
     {
         builder = new AlertDialog.Builder(this);
         builder.SetTitle("Something went wrong...");
         builder.SetMessage("Password are not matching...");
         builder.SetPositiveButton("OK", OkCorrectAction);
         AlertDialog alert = builder.Create();
         alert.Show();
     }
     else
     {
         Service.MemberService backGroundTask = new Service.MemberService(this);
         backGroundTask.Execute("getbyemail", etEmail.Text);
     }
 }
Esempio n. 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.WelcomeUser);
            tvWelcome = (TextView)FindViewById(Resource.Id.txtUserName);
            string memberId = Intent.GetStringExtra("memberId");

            Service.MemberService backGroundTask = new Service.MemberService(this);
            backGroundTask.Execute("getbyid", memberId);
        }
Esempio n. 5
0
 protected override void OnResume()
 {
     base.OnResume();
     m_settingCurrentLogin = m_settingSvc.GetByName(SettingName.CurrentLogin);
     if (m_settingCurrentLogin.Val_2 == "1")
     {
         member_id = Convert.ToInt32(m_settingCurrentLogin.Val_1);
         Service.MemberService backGroundTask = new Service.MemberService(this);
         backGroundTask.Execute("getbyid", member_id.ToString());
     }
 }
Esempio n. 6
0
        protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            if (data != null)
            {
                var memberIdstr = data.GetStringExtra("member_id");
                if (memberIdstr != null)
                {
                    member_id = Convert.ToInt32(memberIdstr);
                }


                Service.MemberService backGroundTask = new Service.MemberService(this);
                backGroundTask.Execute("getbyid", member_id.ToString());

                m_settingCurrentLogin.Val_1 = member_id.ToString();
                m_settingCurrentLogin.Val_2 = "1";
                m_settingSvc.Update(m_settingCurrentLogin);
                Refresh("GoFoodFragment");
            }
        }
Esempio n. 7
0
 private void BtnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         if (etEmail.Text == "" || etPassword.Text == "")
         {
             builder.SetMessage("Please fill all field..");
             builder.SetPositiveButton("OK", OkCorrectAction);
             builder.Create().Show();
         }
         else
         {
             SettingsStringAutoComplete.UpdateAutocomplete(SettingName.Email, etEmail.Text, this);
             Service.MemberService backGroundTask = new Service.MemberService(this);
             backGroundTask.Execute("login", etEmail.Text, etPassword.Text);
         }
     }
     catch (Exception x)
     {
         Toast.MakeText(this, "Please check your internet connection.", ToastLength.Short);
     }
 }
Esempio n. 8
0
 public void SetMemberActivity(string key, Member member)
 {
     if (!CommonService.CheckInternetConnection(this))
     {
         Toast.MakeText(this, "Please check your internet connection", ToastLength.Short).Show(); return;
     }
     if (key == "activateuser")
     {
         Service.MemberService backGroundTask = new Service.MemberService(this);
         backGroundTask = new Service.MemberService(this);
         backGroundTask.Execute("getbyemail", email);
     }
     if (key == "getbyemail")
     {
         if (member == null)
         {
             return;
         }
         if (member.member_status == "Aktif")
         {
             Toast.MakeText(this, "Your account is activated, Please enjoy.", ToastLength.Short).Show();
             Intent i = new Intent();
             i.PutExtra("member_id", member.member_id.ToString());
             SetResult(Result.Ok, i);
             Finish();
         }
         else
         {
             m_member = member;
             builder  = new AlertDialog.Builder(this);
             builder.SetTitle("Information");
             builder.SetMessage("Please fill correct code. ");
             builder.SetPositiveButton("OK", OkAction);
             AlertDialog alert = builder.Create();
             alert.Show();
         }
     }
 }
Esempio n. 9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.title          = this.drawerTitle = this.Title;
            this.drawerLayout   = this.FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            this.drawerListView = this.FindViewById <ListView>(Resource.Id.lv_drawer);
            //Create Adapter for drawer List
            this.drawerListView.Adapter = new ItemMenuAdapter(this, SectionsNoLogin);
            //new ArrayAdapter<string>(this, Resource.Layout.item_menu, Sections);
            //Set click handler when item is selected
            //this.drawerListView.ItemClick += (sender, args) => ListItemClicked(args.Position);
            this.drawerListView.ItemClick += DrawerListView_ItemClick;
            //Set Drawer Shadow
            this.drawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Start);
            //DrawerToggle is the animation that happens with the indicator next to the actionbar
            this.drawerToggle = new MyActionBarDrawerToggle(this, this.drawerLayout,
                                                            this.Toolbar,
                                                            Resource.String.drawer_open,
                                                            Resource.String.drawer_close);
            //Display the current fragments title and update the options menu
            this.drawerToggle.DrawerClosed += (o, args) => {
                this.SupportActionBar.Title = this.title;
                this.InvalidateOptionsMenu();
            };
            //Display the drawer title and update the options menu
            this.drawerToggle.DrawerOpened += (o, args) => {
                this.SupportActionBar.Title = this.drawerTitle;
                this.InvalidateOptionsMenu();
            };
            //Set the drawer lister to be the toggle.
            this.drawerLayout.SetDrawerListener(this.drawerToggle);
            //if first time you will want to go ahead and click first item.
            //     if (savedInstanceState == null)
            //   {
            //  ListItemClicked(0);
            //   }
            //----------------------------------------------------------
            //SetContentView(Resource.Layout.Home);
            //tvWelcomeUser = (TextView)FindViewById(Resource.Id.tvWelcomeUser);
            //string memberId = Intent.GetStringExtra("memberId");
            //Service.MemberService backGroundTask = new Service.MemberService(this);
            //backGroundTask.Execute("getbyid", memberId);
            //tbMain = FindViewById<Toolbar>(Resource.Id.toolbar);
            //SetActionBar(tbMain);
            //ActionBar.Title = "Mr.Go!";
            //var toolbarBottom = FindViewById<Toolbar>(Resource.Id.toolbar_bottom);
            //toolbarBottom.Title = "Photo Editing";
            //toolbarBottom.InflateMenu(Resource.Menu.home);
            // Attach item selected handler to navigation view
            //var navigationView = FindViewById<NavigationView>(Resource.Id.nav_view);
            //navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;
            //check Is LOGIN
            m_settingSvc          = new SettingsServiceLocalDB(this);
            m_settingCurrentLogin = m_settingSvc.GetByName(SettingName.CurrentLogin);
            if (m_settingCurrentLogin == null)
            {
                m_settingCurrentLogin      = new Settings();
                m_settingCurrentLogin.Name = SettingName.CurrentLogin;
                m_settingSvc.Insert(m_settingCurrentLogin);
            }
            if (m_settingCurrentLogin.Val_2 == "1")
            {
                member_id = Convert.ToInt32(m_settingCurrentLogin.Val_1);
                Service.MemberService backGroundTask = new Service.MemberService(this);

                backGroundTask.Execute("getbyid", member_id.ToString());
            }
            //--------------------
            m_GoFoodFragment  = new GoFoodFragment(this, member_id);
            m_MyOrderFragment = new MyOrderFragment(this, member_id);

            startBeranda();
        }