예제 #1
0
        private void BindGridData()
        {
            try
            {
                ServiceWrapper svc = new ServiceWrapper();

                var MYtastings = svc.GetMyTastingsList(customerid).Result;
                myArr1 = MYtastings.TastingList.ToList();
                ListView wineList = FindViewById <ListView>(Resource.Id.MyTasting);
                wineList.Clickable = true;
                MyTastingAdapter adapter = new MyTastingAdapter(this, MYtastings.TastingList.ToList());
                wineList.Adapter    = adapter;
                wineList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
                {
                    string WineBarcode = myArr1[args.Position].Barcode;
                    int    storeID     = myArr1[args.Position].PlantFinal;
                    LoggingClass.LogInfo("Clicked on " + myArr1[args.Position].Barcode + " to enter into wine from tasting  details", screenid);
                    ProgressIndicator.Show(this);
                    var intent = new Intent(this, typeof(DetailViewActivity));
                    intent.PutExtra("WineBarcode", WineBarcode);
                    intent.PutExtra("storeid", storeID);
                    StartActivity(intent);
                };
                ProgressIndicator.Hide();
                AndHUD.Shared.Dismiss();
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
            }
        }
예제 #2
0
        public void RefreshParent()
        {
            ServiceWrapper   svc        = new ServiceWrapper();
            var              MYtastings = svc.GetMyTastingsList(customerid).Result;
            ListView         wineList   = FindViewById <ListView>(Resource.Id.MyTasting);
            MyTastingAdapter adapter    = new MyTastingAdapter(this, MYtastings.TastingList.ToList());

            wineList.Adapter = adapter;
            adapter.NotifyDataSetChanged();
        }
예제 #3
0
        private void BindGridData()
        {
            try
            {
                ServiceWrapper svc = new ServiceWrapper();

                var MYtastings = svc.GetMyTastingsList(customerid).Result;
                myArr1 = MYtastings.TastingList.ToList();

                ListView wineList = FindViewById <ListView>(Resource.Id.MyTasting);
                wineList.Clickable = true;

                MyTastingAdapter adapter = new MyTastingAdapter(this, MYtastings.TastingList.ToList());
                wineList.Adapter    = adapter;
                wineList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
                {
                    string WineBarcode = myArr1[args.Position].Barcode;
                    int    storeID     = myArr1[args.Position].PlantFinal;
                    LoggingClass.LogInfo("Clicked on " + myArr1[args.Position].Barcode + " to enter into wine from tasting  details", screenid);
                    // ProgressIndicator.Show(this);
                    AndHUD.Shared.Show(this, "Loading...", Convert.ToInt32(MaskType.Clear));
                    var intent = new Intent(this, typeof(DetailViewActivity));
                    intent.PutExtra("WineBarcode", WineBarcode);
                    intent.PutExtra("storeid", storeID);
                    StartActivity(intent);
                };
                ProgressIndicator.Hide();
                AndHUD.Shared.Dismiss();

                //TokenModel devInfo = new TokenModel();
                //var activityManager = (ActivityManager)this.GetSystemService(Context.ActivityService);

                //ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
                //activityManager.GetMemoryInfo(memInfo);

                //System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Avail {0} - {1} MB", memInfo.AvailMem, memInfo.AvailMem / 1024 / 1024);
                //System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Low {0}", memInfo.LowMemory);
                //System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Total {0} - {1} MB", memInfo.TotalMem, memInfo.TotalMem / 1024 / 1024);

                //devInfo.AvailableMainMemory = memInfo.AvailMem;
                //devInfo.IsLowMainMemory = memInfo.LowMemory;
                //devInfo.TotalMainMemory = memInfo.TotalMem;
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
            }
        }
예제 #4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            customerid = Convert.ToInt32(CurrentUser.getUserId());

            SetContentView(Resource.Layout.MyTasting);
            try
            {
                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);

                ServiceWrapper svc = new ServiceWrapper();

                var MYtastings = svc.GetMyTastingsList(customerid).Result;

                List <Tastings> myArr;

                //  myArr1 = SampleData1();

                ListView wineList = FindViewById <ListView>(Resource.Id.MyTasting);
                // myArr1 = SampleData1();
                MyTastingAdapter adapter = new MyTastingAdapter(this, MYtastings.TastingList.ToList());
                wineList.Adapter = adapter;
                ProgressIndicator.Hide();
            }

            catch (Exception exe)
            {
                AlertDialog.Builder aler = new AlertDialog.Builder(this);
                aler.SetTitle("Sorry");
                aler.SetMessage("We're under maintainence");
                aler.SetNegativeButton("Ok", delegate { });
                Dialog dialog = aler.Create();
                dialog.Show();
            }
        }
예제 #5
0
        protected override void OnCreate(Bundle bundle)
        {
            Stopwatch st = new Stopwatch();

            st.Start();
            base.OnCreate(bundle);
            customerid = Convert.ToInt32(CurrentUser.getUserId());

            try
            {
                LoggingClass.LogInfo("Entered into My Tasting", screenid);
                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);

                ServiceWrapper svc = new ServiceWrapper();

                var MYtastings = svc.GetMyTastingsList(customerid).Result;
                myArr1 = MYtastings.TastingList.ToList();
                if (MYtastings.TastingList.Count == 0)
                {
                    SetContentView(Resource.Layout.EmptyTaste);
                    TextView te = FindViewById <TextView>(Resource.Id.textView123a);
                    //AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                    ////aler.SetTitle("No Reviews Avalilable");
                    //aler.SetMessage("Sorry you haven't Tasted our wines");
                    //LoggingClass.LogInfo("Sorry you haven't Tasted our wines alert", screenid);
                    //aler.SetNegativeButton("Ok", delegate { Finish(); });
                    //LoggingClass.LogInfo("Clicked on Secaucus", screenid);
                    //Dialog dialog = aler.Create();
                    //dialog.Show();
                }
                else
                {
                    SetContentView(Resource.Layout.MyTasting);
                    ListView wineList = FindViewById <ListView>(Resource.Id.MyTasting);

                    MyTastingAdapter adapter = new MyTastingAdapter(this, MYtastings.TastingList.ToList());
                    wineList.Adapter    = adapter;
                    wineList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
                    {
                        string WineBarcode = myArr1[args.Position].Barcode;
                        int    storeID     = myArr1[args.Position].PlantFinal;
                        LoggingClass.LogInfo("Clicked on " + myArr1[args.Position].Barcode + " to enter into wine from tasting  details", screenid);
                        ProgressIndicator.Show(this);
                        var intent = new Intent(this, typeof(DetailViewActivity));
                        intent.PutExtra("WineBarcode", WineBarcode);
                        intent.PutExtra("storeid", storeID);
                        StartActivity(intent);
                    };
                }
                ProgressIndicator.Hide();
            }

            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                AlertDialog.Builder aler = new AlertDialog.Builder(this);
                aler.SetTitle("Sorry");
                aler.SetMessage("We're under maintainence");
                aler.SetNegativeButton("Ok", delegate { });
                Dialog dialog = aler.Create();
                dialog.Show();
            }
            st.Stop();
            LoggingClass.LogTime("Tastingactivity", st.Elapsed.TotalSeconds.ToString());
        }