Beispiel #1
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            Intent intent = null;

            switch (item.ItemId)
            {
            case Resource.Id.action_settings:
                ProgressIndicator.Show(this);
                intent = new Intent(this, typeof(ProfileActivity));
                LoggingClass.LogInfo("Clicked on options menu Profile", screenid);
                break;

            case Resource.Id.action_settings1:
                //ProgressIndicator.Show(this);
                try
                { intent = new Intent(this, typeof(AboutActivity)); }
                catch (Exception ex)
                { }

                LoggingClass.LogInfo("Clicked on options menu About", screenid);
                break;

            case Resource.Id.action_settings2:
                MoveTaskToBack(true);
                LoggingClass.LogInfo("Exited from App", screenid);
                break;

            default:    //invalid option
                return(base.OnOptionsItemSelected(item));
            }
            if (intent != null)
            {
                StartActivity(intent);
            }
            try
            {
                //if (item.ItemId == Resource.Id.action_settings3)
                //{
                //    ProgressIndicator.Show(this);
                //    StartActivity(typeof(AutoCompleteTextActivity));
                //}
            }

            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                throw new Exception();
            }

            if (item.ItemId == Android.Resource.Id.Home)
            {
                Finish();
                LoggingClass.LogInfo("Clicked on Exit", screenid);
                return(false);
            }
            return(base.OnOptionsItemSelected(item));
        }
Beispiel #2
0
        private void BtnUpdateEmail_Click(string Message)
        {
            try
            {
                AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                LoggingClass.LogInfo("Entered Incorrect Details", screenid);
                aler.SetTitle(Message);

                EditText txtEmail = new EditText(this);
                txtEmail.SetTextColor(Color.Black);
                txtEmail.FocusableInTouchMode = true;
                aler.SetView(txtEmail);
                aler.SetPositiveButton("Update", async delegate
                {
                    int count = 0;
                    if (count == 0)
                    {
                        if (txtEmail.Text == null && txtEmail.Text == "")
                        {
                            //BTProgressHUD.ShowErrorWithStatus("Email is invalid",3000);
                            BtnUpdateEmail_Click("Entered email id is invalid,Please enter again");
                        }
                        else if (txtEmail.Text.Contains("@") != true && txtEmail.Text.Contains(".") != true)
                        {
                            BtnUpdateEmail_Click("Entered email id is invalid,Please enter again");
                        }
                        else
                        {
                            AndHUD.Shared.Show(this, "Updating...Please Wait...", Convert.ToInt32(MaskType.Clear));
                            //BTProgressHUD.ShowSuccessWithStatus("We're sending mail to the updated mail");
                            //CurrentUser.PutEmail(txtEmail.Text);
                            AuthServ = await svc.UpdateMail(txtEmail.Text, AuthServ.customer.CustomerID.ToString());
                            ShowInfo(AuthServ);
                            AndHUD.Shared.Dismiss();

                            //AndHUD.Shared.ShowSuccess(Parent, "Updated!", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                    }
                    count = 1;
                });

                aler.SetNegativeButton("Cancel", (senderAlert, args) =>
                {
                    int cou = 0;
                    if (cou == 0)
                    {
                        Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show();
                    }
                    cou = 1;
                });

                Dialog dialog = aler.Create();
                dialog.Show();
            }
            catch (Exception ex) { }
        }
        // SwipeRefreshLayout refresher1;



        protected override void OnCreate(Bundle bundle)
        {
            Stopwatch st = new Stopwatch();

            st.Start();
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            try
            {
                CheckInternetConnection();
                if (StoreName == "")
                {
                    StoreName = Intent.GetStringExtra("MyData");
                }
                this.Title = StoreName;
                this.ActionBar.SetHomeButtonEnabled(true);
                this.ActionBar.SetDisplayShowTitleEnabled(true);//  ToolbartItems.Add(new ToolbarItem { Text = "BTN 1", Icon = "myicon.png" });

                BindGridData();

                SwipeRefreshLayout mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.PullDownRefresh);

                //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 grid view", screenid);
                    await SomeAsync();

                    mSwipeRefreshLayout.Refreshing = false;
                };

                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);

                ProgressIndicator.Hide();
                LoggingClass.LogInfo("Entered into gridview activity", screenid);
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                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("Gridactivity", st.Elapsed.TotalSeconds.ToString());
        }
Beispiel #4
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     if (item.ItemId == Android.Resource.Id.Home)
     {
         base.OnBackPressed();
         LoggingClass.LogInfo("Exited from My Favorites", screenid);
         return(false);
     }
     return(base.OnOptionsItemSelected(item));
 }
Beispiel #5
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     if (item.ItemId == Android.Resource.Id.Home)
     {
         Finish();
         LoggingClass.LogInfo("Exited from My Tasting", screenid);
         return(false);
     }
     return(base.OnOptionsItemSelected(item));
 }
Beispiel #6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.EditReviewPopup, container, false);

            LoggingClass.LogInfo("Entered into editreview popup", screenid);


            return(view);
        }
Beispiel #7
0
        private void TakeAPicture(object sender, EventArgs eventArgs)
        {
            Intent intent = new Intent(MediaStore.ActionImageCapture);

            App._file = new Java.IO.File(App._dir, String.Format(Convert.ToInt32(CurrentUser.getUserId()) + ".jpg", Guid.NewGuid()));
            path     += "/" + CurrentUser.getUserId() + ".jpg";
            intent.PutExtra(MediaStore.ExtraOutput, Uri.FromFile(App._file));
            StartActivityForResult(intent, 0);

            LoggingClass.LogTime("Tak pic", "time");
        }
Beispiel #8
0
        public void IncorrectDetailsAlert()
        {
            AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
            LoggingClass.LogInfo("Entered Incorrect Details", screenid);
            aler.SetTitle("Sorry");
            aler.SetMessage("Incorrect Details");
            aler.SetNegativeButton("Ok", delegate { });
            Dialog dialog = aler.Create();

            dialog.Show();
        }
Beispiel #9
0
        public void ThankuYouAlert()
        {
            AlertDialog.Builder alert = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
            LoggingClass.LogInfo("Successfully you logged in", screenid);
            alert.SetTitle("Successfully you logged in");
            alert.SetMessage("Thank You");
            alert.SetNegativeButton("Ok", delegate { });
            Dialog dialog = alert.Create();

            dialog.Show();
        }
Beispiel #10
0
        public void UndermaintenenceAlert()
        {
            AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
            aler.SetTitle("Sorry");
            LoggingClass.LogInfo("We're under maintanence", screenid);
            aler.SetMessage("We're under maintanence");
            aler.SetNegativeButton("Ok", delegate { });
            Dialog dialog = aler.Create();

            dialog.Show();
        }
Beispiel #11
0
        public void UnAuthourised()
        {
            AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
            aler.SetTitle("Invalid Credentials");
            LoggingClass.LogInfo("Invalid Credentials", screenid);
            aler.SetMessage("BarCode is invalid. Please try again!");
            aler.SetNegativeButton("Ok", delegate { });
            Dialog dialog = aler.Create();

            dialog.Show();
        }
Beispiel #12
0
        public void CheckInternetAlert()
        {
            AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
            aler.SetTitle("Sorry");
            LoggingClass.LogInfo("Please check your internet connection", screenid);
            aler.SetMessage("Please check your internet connection");
            aler.SetNegativeButton("Ok", delegate { });
            Dialog dialog = aler.Create();

            dialog.Show();
        }
        public async void SendRegistrationToAppServer(string token)
        {
            TokenModel _token = new TokenModel()
            {
                User_id     = Convert.ToInt32(CurrentUser.getUserId()),
                DeviceToken = token,
                DeviceType  = 1
            };

            LoggingClass.LogInfoEx("Token sent to db", screenid);
            int x = await svc.InsertUpdateToken1(_token);
        }
        public async void ShowInfo(CustomerResponse AuthServ)
        {
            AndHUD.Shared.Show(this, "Please Wait...", Convert.ToInt32(MaskType.Clear));
            try
            {
                if (AuthServ.customer.Email != "" && AuthServ.customer.Email != null)
                {
                    TxtScanresult.Text = AuthServ.ErrorDescription;// " Hi " + AuthServ.customer.FirstName + authen.customer.LastName + ",\n We have sent an email at  " + authen.customer.Email + ".\n Please verify email to continue login. \n If you have not received email Click Resend Email.\n To get Email Id changed, contact store.";

                    TxtScanresult.SetTextColor(Android.Graphics.Color.Black);
                    BtnResend.Visibility      = ViewStates.Visible;
                    txtmail.Visibility        = ViewStates.Gone;
                    Txtem.Visibility          = ViewStates.Gone;
                    BtnLogin.Visibility       = ViewStates.Visible;
                    BtnContinue.Visibility    = ViewStates.Gone;
                    BtnUpdateEmail.Visibility = ViewStates.Gone;
                    update.Visibility         = ViewStates.Gone;
                    BtnResend.Click          += async delegate
                    {
                        try
                        { AndHUD.Shared.Show(this, "Sending verification email to " + AuthServ.customer.Email, Convert.ToInt32(MaskType.Clear));
                          LoggingClass.LogInfo("Resend email " + AuthServ.customer.Email, screenid);
                          await svc.ResendEMail(CurrentUser.GetCardNumber());

                          AndHUD.Shared.ShowSuccess(this, "Sent", MaskType.Clear, TimeSpan.FromSeconds(2));
                          AndHUD.Shared.Dismiss(); }
                        catch (Exception ex)
                        {
                        }
                    };
                    BtnLogin.Click += delegate
                    {
                        LoggingClass.LogInfo("Clicked on Login " + AuthServ.customer.CardNumber, screenid);
                        AndHUD.Shared.Show(this, "Checking Email Verification", Convert.ToInt32(MaskType.Clear));
                        EmailVerification(true);
                    };
                }
                else
                {
                    TxtScanresult.Text = AuthServ.ErrorDescription;
                    TxtScanresult.SetTextColor(Android.Graphics.Color.Red);
                }
                AndHUD.Shared.Dismiss();
            }

            catch (Exception ex)
            {
                LoggingClass.LogError(ex.Message, screenid, ex.StackTrace);
            }

            AndHUD.Shared.Dismiss();
        }
Beispiel #15
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     try
     {
         base.OnCreate(savedInstanceState);
         ActionBar.SetHomeButtonEnabled(true);
         ActionBar.SetDisplayHomeAsUpEnabled(true);
         SetContentView(Resource.Layout.About);
         LoggingClass.LogInfo("Entered into About Us", screenid);
     }
     catch
     { }
 }
Beispiel #16
0
        public async void UploadProfilePicimagebutes(byte[] bitmapData)
        {
            Microsoft.WindowsAzure.Storage.Auth.StorageCredentials sc = new StorageCredentials("icsintegration", "+7UyQSwTkIfrL1BvEbw5+GF2Pcqh3Fsmkyj/cEqvMbZlFJ5rBuUgPiRR2yTR75s2Xkw5Hh9scRbIrb68GRCIXA==");
            CloudStorageAccount storageaccount = new CloudStorageAccount(sc, true);
            CloudBlobClient     blobClient     = storageaccount.CreateCloudBlobClient();
            CloudBlobContainer  container      = blobClient.GetContainerReference("profileimages");
            await container.CreateIfNotExistsAsync();

            CloudBlockBlob blob = container.GetBlockBlobReference(CurrentUser.getUserId() + ".jpg");

            LoggingClass.LogInfo("Updated profile picture", screenid);
            await blob.UploadFromByteArrayAsync(bitmapData, 0, bitmapData.Length);
        }
Beispiel #17
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);
                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 += async delegate {
                        //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 async Task <ItemReviewResponse> GetItemReviewsByWineBarcode(string WineBarcode)
        {
            sw.Start();
            LoggingClass.LogServiceInfo("service called", "GetItemReviewsByWineBarcode");
            var uri      = new Uri(ServiceURL + "/GetReviewsBarcode/" + WineBarcode);
            var response = await client.GetStringAsync(uri).ConfigureAwait(false);

            var output = JsonConvert.DeserializeObject <ItemReviewResponse>(response);

            LoggingClass.LogServiceInfo("service responce", "GetItemReviewsByWineBarcode");
            sw.Stop();
            LoggingClass.LogTime("The total time to  start and end the service GetItemReviewsByWineBarcode", "The timer ran for " + sw.Elapsed.TotalSeconds);
            return(output);
        }
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     if (item.ItemId == Android.Resource.Id.Home)
     {
         //MoveTaskToBack(true);
         //Finish();
         //LoggingClass.LogInfo("Exited from profile ", screenid);
         //return false;
         var intent = new Intent(this, typeof(TabActivity));
         LoggingClass.LogInfo("Clicked on options menu About", screenid);
         StartActivity(intent);
     }
     return(base.OnOptionsItemSelected(item));
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
			

            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.AboutLayout);
            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            LoggingClass.LogInfo("Entered into About Us",screenid);
			

			//LoggingClass.LogTime("Aboutus time", sw.Elapsed.Seconds.ToString());
            // Create your application here
        }
Beispiel #21
0
        public async void Preinfo(string CardNumber)
        {
            AndHUD.Shared.Show(this, "Please Wait", Convert.ToInt32(MaskType.Clear));
            try
            {
                BtnLogin.Visibility  = ViewStates.Invisible;
                BtnResend.Visibility = ViewStates.Invisible;
                AuthServ             = await svc.AuthencateUser("test", CardNumber, CurrentUser.GetDeviceID());

                LoggingClass.LogInfo("User Tried to login with " + CardNumber, screenid);
                if (CardNumber != null)
                {
                    CurrentUser.SaveCardNumber(CardNumber);
                }
                if (AuthServ != null)
                {
                    if (AuthServ.customer.Email != "" && AuthServ.customer.Email != null)
                    {
                        TxtScanresult.Text = AuthServ.ErrorDescription;//" Hi " + authen.customer.FirstName + authen.customer.LastName + ",\n We have sent an email at  " + authen.customer.Email + ".\n Please verify email to continue login. \n If you have not received email Click Resend Email.\n To get Email Id changed, contact store.";
                        TxtScanresult.SetTextColor(Android.Graphics.Color.Black);
                        BtnContinue.Visibility    = ViewStates.Visible;
                        BtnUpdateEmail.Visibility = ViewStates.Visible;
                        BtnContinue.Click        += async delegate
                        {
                            AndHUD.Shared.Show(this, " Please Wait", Convert.ToInt32(MaskType.Clear));
                            AuthServ = await svc.ContinueService(AuthServ);

                            ShowInfo(AuthServ);
                            AndHUD.Shared.Dismiss();
                        };
                        BtnUpdateEmail.Click += delegate
                        {
                            BtnUpdateEmail_Click("please enter your new e-mail id");
                        };
                    }
                }
                else
                {
                    TxtScanresult.Text   = "Sorry. Your Card number is not matching our records.\n Please re-scan Or Try app as Guest Log In.";
                    BtnResend.Visibility = ViewStates.Invisible;
                    BtnLogin.Visibility  = ViewStates.Invisible;
                    TxtScanresult.SetTextColor(Android.Graphics.Color.Red);
                    AndHUD.Shared.Dismiss();
                }
                AndHUD.Shared.Dismiss();
            }
            catch (Exception exe)
            {
            }
        }
Beispiel #22
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());
            }
        }
        public async Task <ItemListResponse> GetItemFavsUID(int userId)
        {
            sw.Start();
            LoggingClass.LogServiceInfo("service called", "csfavs");
            var uri      = new Uri(ServiceURL + "GetItemFavUID/" + userId);
            var response = await client.GetStringAsync(uri).ConfigureAwait(false);

            var output = JsonConvert.DeserializeObject <ItemListResponse>(response);

            LoggingClass.LogServiceInfo("service responce", "csfavs");
            sw.Stop();

            LoggingClass.LogTime("The total time to  start and end the service GetItemFavsUID", "The timer ran for " + sw.Elapsed.TotalSeconds);

            return(output);
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.ItemId == Android.Resource.Id.Home)
            {
                base.OnBackPressed();

                var intent = new Intent(this, typeof(TabActivity));
                LoggingClass.LogInfo("Clicked on options menu About", screenid);
                StartActivity(intent);
                LoggingClass.LogInfo("Exited from Gridview Activity", screenid);
                TokenModel devInfo         = new TokenModel();
                var        activityManager = (ActivityManager)this.GetSystemService(Context.ActivityService);
                return(true);
            }
            return(base.OnOptionsItemSelected(item));
        }
Beispiel #25
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            Stopwatch st = new Stopwatch();

            st.Start();
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.DeleteReviewPop, container, false);

            LoggingClass.LogInfo("Entered into Delete review popup with" + WineBarcode, screenid);
            ServiceWrapper sw     = new ServiceWrapper();
            Review         review = new Review();
            Button         Delete = view.FindViewById <Button>(Resource.Id.button1);
            Button         Cancel = view.FindViewById <Button>(Resource.Id.button2);

            try
            {
                Delete.Click += async delegate
                {
                    AndHUD.Shared.Show(Parent, "Deleting  Review...", Convert.ToInt32(MaskType.Clear));
                    review.Barcode = WineBarcode;
                    // ProgressIndicator.Show(Parent);
                    review.ReviewUserId = Convert.ToInt32(CurrentUser.getUserId());

                    await sw.DeleteReview(review);

                    ((IPopupParent)Parent).RefreshParent();
                    ProgressIndicator.Hide();
                    myDialog.Dismiss();
                    AndHUD.Shared.Dismiss();
                    AndHUD.Shared.ShowSuccess(Parent, "Sucessfully Deleted", MaskType.Clear, TimeSpan.FromSeconds(2));

                    LoggingClass.LogInfoEx("User deleted winereview" + WineBarcode + "from " + review.PlantFinal + "st Store", screenid);
                };
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
            }
            Cancel.Click += delegate
            {
                LoggingClass.LogInfo("clicked on cancel" + WineBarcode + review.PlantFinal, screenid);
                myDialog.Dismiss();
            };
            st.Stop();
            LoggingClass.LogTime("Deletereview time", st.Elapsed.TotalSeconds.ToString());
            return(view);
        }
        public async Task <TastingListResponse> GetMyTastingsList(int customerid)
        {
            sw.Start();
            //customerid = 38691;
            LoggingClass.LogServiceInfo("service called", "GetMyTastingsList");
            var uri      = new Uri(ServiceURL + "GetMyTastingsList/" + customerid);
            var response = await client.GetStringAsync(uri).ConfigureAwait(false);

            var output = JsonConvert.DeserializeObject <TastingListResponse>(response);

            sw.Stop();

            LoggingClass.LogTime("The total time to  start and end the service GetMyTastingsList", "The timer ran for " + sw.Elapsed.TotalSeconds);

            LoggingClass.LogServiceInfo("service responce", "GetMyTastingsList");
            return(output);
        }
Beispiel #27
0
        public async Task <CustomerResponse> GetCustomerDetails(int userID)
        {
            sw.Start();
            //LoggingClass.LogServiceInfo("service called", "GetCustomerDetails");
            var uri      = new Uri(ServiceURL + "GetCustomerDetails/" + userID);
            var response = await client.GetStringAsync(uri).ConfigureAwait(false);

            var output = JsonConvert.DeserializeObject <CustomerResponse>(response);

            LoggingClass.LogServiceInfo("service responce", "GetCustomerDetails");
            sw.Stop();

            //LoggingClass.LogTime("The total time to  start and end the service GetCustomerDetails", "The timer ran for " + sw.Elapsed.TotalSeconds);


            return(output);
        }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View row = convertView;
            if (row == null)
                row = LayoutInflater.From(myContext).Inflate(Resource.Layout.WinePropertiesCell, null, false);
			LoggingClass.LogInfo("Entered into DetailsViewAdapter", screenid);
            TextView Type = row.FindViewById<TextView>(Resource.Id.textView12);
            TextView Value = row.FindViewById<TextView>(Resource.Id.textView13);
            Type.LayoutParameters.Width = 550;
            //TextView txtUserRatings = row.FindViewById<TextView>(Resource.Id.txtUserRatings);
            //TextView txtPrice = row.FindViewById<TextView>(Resource.Id.txtPrice);
            //ImageView imgWine = row.FindViewById<ImageView>(Resource.Id.imgWine);


            Type.Text = myItems[position].Name;
            Value.Text = myItems[position].Vintage.ToString();
            //Type.Text = myItems[position].Classification;
            //Value.Text = myItems[position].ClassificationValue;
            //Type.Text = myItems[position].Grapetype;
            //Value.Text = myItems[position].GrapeTypeValue;
            //Type.Text = myItems[position].Alcohol;
            //Value.Text = myItems[position].AlcoholValue;
            //Type.Text = myItems[position].Vintage;
            //Value.Text = myItems[position].VintageValue;
            //Type.Text = myItems[position].Aromas;
            //Value.Text = myItems[position].AromasValue;
            //Type.Text = myItems[position].FoodPairings;
            //Value.Text = myItems[position].FoodPairingsValue;
            //Type.Text = myItems[position].Bottlesize;
            //Value.Text = myItems[position].BottleSizeValue;
            //Type.Text = myItems[position].ServingAt;
            //Value.Text = myItems[position].ServingAtValue;
            //imgWine.SetImageURI(new Uri(myItems[position].imageURL));

            //var imageBitmap = GetImageBitmapFromUrl(myItems[position].imageURL);
            //imgWine.SetImageBitmap(imageBitmap);

            Type.Focusable = false;
            Value.Focusable = false;
            //txtUserRatings.Focusable = false;
            //txtPrice.Focusable = false;
            //imgWine.Focusable = false;


            return row;
        }
        // Use Notification Builder to create and launch the notification:
        void SendNotification(string message, string WineBarcode)
        {
            try {
                Stopwatch st1 = new Stopwatch();
                Intent    intent;
                if (WineBarcode == "-1")
                {
                    intent = new Intent(this, typeof(Login));
                    intent.AddFlags(ActivityFlags.ClearTop);
                    intent.AddFlags(ActivityFlags.ClearTask);
                    intent.AddFlags(ActivityFlags.NewTask);
                }
                else
                {
                    intent = new Intent(this, typeof(DetailViewActivity));
                    intent.PutExtra("WineBarcode", WineBarcode);
                    string Back = "Back";
                    intent.PutExtra("Back", Back);
                    intent.AddFlags(ActivityFlags.ClearTop);
                    intent.AddFlags(ActivityFlags.ClearTask);
                    intent.AddFlags(ActivityFlags.NewTask);
                }
                //System.TimeSpan ts = new System.TimeSpan((System.Int64)10e12+3456789);
                st1.Start();
                int requestid = st1.Elapsed.Milliseconds;

                var pendingIntent = PendingIntent.GetActivity(this, requestid, intent, PendingIntentFlags.OneShot);
                LoggingClass.LogInfo("Notification Sent\n" + intent + "Notification Sent\n" + pendingIntent, 1);
                var notificationBuilder = new Notification.Builder(this)
                                          .SetSmallIcon(Resource.Drawable.logo5)
                                          .SetContentTitle("Wine Outlet")
                                          .SetContentText(message)
                                          .SetAutoCancel(false)
                                          .SetContentIntent(pendingIntent);
                notificationBuilder.SetAutoCancel(true);
                //int notificationId = new Random().NextInt();
                // System.TimeSpan ts = new System.TimeSpan((System.Int64)10e12 + 3456789);
                LoggingClass.LogInfo("Notification Sent" + WineBarcode, 1);
                int notificationId      = new Random().NextInt();
                var notificationManager = (NotificationManager)GetSystemService(Context.NotificationService);
                notificationManager.Notify(notificationId, notificationBuilder.Build());
            }catch (System.Exception ex) {
                LoggingClass.LogError(ex.Message, 1, ex.StackTrace);
            }
        }
Beispiel #30
0
        public override void OnBackPressed()
        {
            MoveTaskToBack(true);
            LoggingClass.LogInfo("Clicked on back button", screenid);
            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;
        }