Esempio n. 1
0
        public override void OnActivityResult(int requestCode, int resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            if (data != null)
            {
                var memberIdstr = data.GetStringExtra("member_id");
                if (memberIdstr != null)
                {
                    m_member_id = Convert.ToInt32(memberIdstr);
                }

                //Service.MemberService backGroundTask = new Service.MemberService(this);
                //backGroundTask.Execute("getbyid", m_member_id.ToString());
                SettingsServiceLocalDB m_settingSvc = new SettingsServiceLocalDB(Activity);
                Settings m_settingCurrentLogin      = m_settingSvc.GetByName(SettingName.CurrentLogin);
                m_settingCurrentLogin.Val_1 = m_member_id.ToString();
                m_settingCurrentLogin.Val_2 = "1";
                m_settingSvc.Update(m_settingCurrentLogin);
                buttonPesan.Text = m_member_id > 0 ? "PESAN" : "SILAHKAN LOGIN / SIGN UP UNTUK PESAN";

                var orderResult = data.GetStringExtra("ordered");
                //  if (orderResult != null)
                //  {
                // if (orderResult.ToString() == "OK")
                //  Finish();
                //}
            }
        }
Esempio n. 2
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();
        }