Пример #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            View   ignored  = base.OnCreateView(inflater, container, savedInstanceState);
            View   view     = inflater.Inflate(Resource.Layout.page_resto_menu_mrrecommend, null);
            string resto_id = "1";
            //string resto_name = "Mr Recommend";
            //string resto_address = "Mr Go";
            //string resto_url_image = "";
            RestoService service = new RestoService(this);

            service.Execute("GetRestoByID", resto_id);

            MenuRestoService mnService = new MenuRestoService(this);

            mnService.Execute("GetMenuByRestoID", resto_id);

            m_menuGridSpesial = view.FindViewById <GridView>(Resource.Id.gridMenuSpesial);
            m_menuGridMinuman = view.FindViewById <GridView>(Resource.Id.gridMenuMinuman);
            m_menuGridMakanan = view.FindViewById <GridView>(Resource.Id.gridMenuMakanan);

            buttonPesan = view.FindViewById <Button>(Resource.Id.buttonPesan);

            buttonPesan.Text   = m_member_id > 0 ? "PESAN" : "SILAHKAN LOGIN / SIGN UP UNTUK PESAN";
            buttonPesan.Click += ButtonPesan_Click;

            return(view);
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            m_trService  = new TransactionService(this);
            builder      = new AlertDialog.Builder(this);
            m_menuId     = Intent.GetStringExtra("menuId");
            m_menuJumlah = Intent.GetStringExtra("menuJumlah");
            string resto_id        = Intent.GetStringExtra("resto_id");
            string resto_name      = Intent.GetStringExtra("resto_name");
            string resto_address   = Intent.GetStringExtra("resto_address");
            string resto_url_image = Intent.GetStringExtra("resto_url_image");

            m_ongkir    = Convert.ToDecimal(Intent.GetStringExtra("resto_jumlah_ongkir"));
            m_member_id = Convert.ToInt32(Intent.GetStringExtra("member_id"));
            MenuRestoService mnService = new MenuRestoService(this);

            mnService.Execute("GetMenuByIDInSelect", m_menuId);
            m_gridReview = FindViewById <GridView>(Resource.Id.gridMenuPesanan);
            // Create your application here
            SupportActionBar.Title  = resto_name;
            m_tvTotalBeli           = FindViewById <TextView>(Resource.Id.textViewTotalBeli);
            m_tvTotalSemua          = FindViewById <TextView>(Resource.Id.textViewTotalSemua);
            m_tvBiayaKirim          = FindViewById <TextView>(Resource.Id.textViewBiayaKirim);
            m_etDelAddress          = FindViewById <EditText>(Resource.Id.editTextDelAddress);
            m_btnPesan              = FindViewById <Button>(Resource.Id.buttonPesan);
            m_btnPesan.Click       += M_btnPesan_Click;
            m_transaction.member_id = m_member_id;
            m_transaction.resto_id  = Convert.ToInt32(resto_id);
        }
Пример #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // var act = Intent.GetSerializableExtra("resto");
            m_ImageLoader = new ImageLoaderMrGo(this, 800, 0);
            string resto_id        = Intent.GetStringExtra("resto_id");
            string resto_name      = Intent.GetStringExtra("resto_name");
            string resto_address   = Intent.GetStringExtra("resto_address");
            string resto_url_image = Intent.GetStringExtra("resto_url_image");

            m_member_id = Convert.ToInt32(Intent.GetStringExtra("member_id"));
            RestoService service = new RestoService(this);

            service.Execute("GetRestoByID", resto_id);

            MenuRestoService mnService = new MenuRestoService(this);

            mnService.Execute("GetMenuByRestoID", resto_id);

            //_friends = Util.GenerateFriends();
            //_friends.RemoveRange(0, _friends.Count - 2);
            //string title = Intent.GetStringExtra("Title");
            //string image = Intent.GetStringExtra("Image");

            resto_name = string.IsNullOrWhiteSpace(resto_name) ? "Resto" : resto_name;
            this.Title = resto_name;

            //if (string.IsNullOrWhiteSpace(resto_url_image))
            //    image = _friends[0].Image;


            m_ImageLoader.DisplayImageLinearLayOut(resto_url_image, this.FindViewById <LinearLayout>(Resource.Id.ll_background), -1);
            this.FindViewById <TextView>(Resource.Id.resto_name).Text    = resto_name;
            this.FindViewById <TextView>(Resource.Id.resto_address).Text = resto_address;

            m_menuGridSpesial = FindViewById <GridView>(Resource.Id.gridMenuSpesial);
            m_menuGridMinuman = FindViewById <GridView>(Resource.Id.gridMenuMinuman);
            m_menuGridMakanan = FindViewById <GridView>(Resource.Id.gridMenuMakanan);


            // grid.Adapter = new MonkeyAdapter(this, _friends);
            //m_menuGridSpesial.ItemClick += GridOnItemClick;
            //m_menuGridMinuman.ItemClick += GridOnItemClick;

            //set title here
            SupportActionBar.Title = Title;

            //   mBtnMenuMakanan = FindViewById<Button>(Resource.Id.btnMenuMakanan);
            //   mBtnMenuMinuman = FindViewById<Button>(Resource.Id.btnMenuMinuman);
            buttonPesan = FindViewById <Button>(Resource.Id.buttonPesan);

            buttonPesan.Text = m_member_id > 0 ? "PESAN" : "SILAHKAN LOGIN / SIGN UP UNTUK PESAN";
            // mBtnMenuMakanan.Click += MBtnMenuMakanan_Click;
            //  mBtnMenuMinuman.Click += MBtnMenuMinuman_Click;
            buttonPesan.Click += ButtonPesan_Click;
        }
Пример #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // var act = Intent.GetSerializableExtra("resto");
            m_ImageLoader = new ImageLoaderMrGo(this, 800, 0);
            string resto_id        = Intent.GetStringExtra("resto_id");
            string resto_name      = Intent.GetStringExtra("resto_name");
            string resto_address   = Intent.GetStringExtra("resto_address");
            string resto_url_image = Intent.GetStringExtra("resto_url_image");

            menu_foodtype = Intent.GetStringExtra("menu_foodtype");
            menuId        = Intent.GetStringExtra("menuId");
            menuJumlah    = Intent.GetStringExtra("menuJumlah");
            RestoService service = new RestoService(this);

            service.Execute("GetRestoByID", resto_id);
            MenuRestoService mnService = new MenuRestoService(this);

            if (menu_foodtype == "MAKANAN")
            {
                mnService.Execute("GetMenuMakananByRestoID", resto_id);
            }
            else
            {
                mnService.Execute("GetMenuMinumanByRestoID", resto_id);
            }
            resto_name = string.IsNullOrWhiteSpace(resto_name) ? "Resto" : resto_name;
            this.Title = resto_name;
            this.FindViewById <TextView>(Resource.Id.textViewJenis).Text = menu_foodtype == "MAKANAN" ? "Menu Makanan" : "Menu Minuman";

            m_menuGridSpesial = FindViewById <GridView>(Resource.Id.gridMenuMakanan);
            //m_menuGridMinuman = FindViewById<GridView>(Resource.Id.gridMenuMinuman);
            // grid.Adapter = new MonkeyAdapter(this, _friends);
            m_menuGridSpesial.ItemClick += GridOnItemClick;
            //m_menuGridMinuman.ItemClick += GridOnItemClick;
            //set title here
            SupportActionBar.Title = Title;
        }
Пример #5
0
        public void SetBackGroundResult(string key, object result)
        {
            if (!CommonService.CheckInternetConnection(this))
            {
                Toast.MakeText(this, "Please check your internet connection", ToastLength.Short).Show(); return;
            }
            if (key == "getByID")
            {
                if (result == null)
                {
                    return;
                }
                else
                {
                    List <Transaction> m_listTr = (List <Transaction>)result;
                    if (m_listTr.Count == 0)
                    {
                        return;
                    }
                    m_transaction = m_listTr[0];
                    loadItems();
                }
            }
            if (key == "getTrDetailByTrId")
            {
                if (result == null)
                {
                    return;
                }
                else
                {
                    m_transaction.Items = (List <TransactionDetail>)result;
                    loadTransactionToView();

                    string menus = "";
                    int    count = 0;
                    foreach (TransactionDetail dtl in m_transaction.Items)
                    {
                        if (count == 0)
                        {
                            menus = dtl.menu_id.ToString();
                        }
                        else
                        {
                            menus += ("," + dtl.menu_id.ToString());
                        }
                        count++;
                    }
                    MenuRestoService svc = new MenuRestoService(this);
                    svc.Execute("GetMenuByIDInSelect", menus);
                }
            }
            if (key == "GetMenuByIDInSelect")
            {
                if (result == null)
                {
                    return;
                }
                m_orderedMenu = (List <MenuResto>)result;
                foreach (MenuResto menu in m_orderedMenu)
                {
                    foreach (TransactionDetail dtl in m_transaction.Items)
                    {
                        if (menu.menu_id == dtl.menu_id)
                        {
                            menu.menu_jumlah_pesan = dtl.tr_unit;
                        }
                    }
                }
                loadReview();
            }
            if (key == "updateStatus")
            {
                if (m_transaction.transaction_status == TransactionStatus.Cancel)
                {
                    m_btnCancelPesan.Visibility = (m_transaction.transaction_status == TransactionStatus.Waiting) ? ViewStates.Visible : ViewStates.Gone;
                    Toast.MakeText(this, "Order Cancelled", ToastLength.Short).Show();
                }
            }
        }