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()); } }
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); this.ActionBar.SetHomeButtonEnabled(true); this.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); } else { SetContentView(Resource.Layout.MyTasting); BindGridData(); SwipeRefreshLayout mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.PullDownRefresh1); //mSwipeRefreshLayout.Refresh += MSwipeRefreshLayout_Refresh; //mSwipeRefreshLayout.SetColorScheme(Resource.Color.abc_background_cache_hint_selector_material_dark, Resource.Color.abc_background_cache_hint_selector_material_light); mSwipeRefreshLayout.Refresh += async delegate { //BindGridData(); LoggingClass.LogInfo("Refreshed My Tasting", screenid); await SomeAsync(); mSwipeRefreshLayout.Refreshing = false; }; ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); } 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()); }
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(); }
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()); } }
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(); } }
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()); }
protected override void OnCreate(Bundle bundle) { Stopwatch st = new Stopwatch(); st.Start(); base.OnCreate(bundle); uid = Convert.ToInt32(CurrentUser.getUserId()); try { ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper svc = new ServiceWrapper(); ItemReviewResponse uidreviews = new ItemReviewResponse(); uidreviews = svc.GetItemReviewUID(uid).Result; List <Review> myArr1; myArr1 = uidreviews.Reviews.ToList(); int c = uidreviews.Reviews.Count; if (c == 0) { var data = svc.GetMyTastingsList(uid).Result; SetContentView(Resource.Layout.ReviewEmpty); txtName = FindViewById <TextView>(Resource.Id.textView1); if (data.TastingList.Count != 0) { txtName.Text = "You have tasted " + data.TastingList.Count + " wines.\n We would love to hear your feedback."; } else { txtName.Text = "Please taste and then review."; } Imag = FindViewById <ImageView>(Resource.Id.imageView1); var TaskA = new System.Threading.Tasks.Task(() => { Imag.SetImageResource(Resource.Drawable.ReviewIns); }); TaskA.Start(); } else { SetContentView(Resource.Layout.MyReviews); var wineList = FindViewById <ListView>(Resource.Id.listView1); Review edit = new Review(); ReviewPopup editPopup = new ReviewPopup(this, edit); MyReviewAdapter adapter = new MyReviewAdapter(this, myArr1); wineList.Adapter = adapter; wineList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { string WineBarcode = myArr1[args.Position].Barcode; int storeID = Convert.ToInt32(myArr1[args.Position].PlantFinal); LoggingClass.LogInfoEx("Clicked on " + myArr1[args.Position].Barcode + " to enter into wine details From ReviewAct", 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); }; LoggingClass.LogInfo("Entered into My Review", screenid); } ProgressIndicator.Hide(); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); AndHUD.Shared.Dismiss(); ProgressIndicator.Hide(); 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("Reviewactivity", st.Elapsed.TotalSeconds.ToString()); }