コード例 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.ProfileCell);
            int userId = Convert.ToInt32(CurrentUser.getUserId());

            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ServiceWrapper sw     = new ServiceWrapper();
            var            output = sw.GetCustomerDetails(userId).Result;

            RefreshParent();
            if (CurrentUser.getUserId() == "0" || CurrentUser.getUserId() == null)
            {
                AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                aler.SetTitle("Sorry");
                aler.SetMessage("This feature is available only  for VIP Users");
                aler.SetPositiveButton("Log in", delegate
                {
                    string str = null;
                    CurrentUser.SaveGuestId(str);
                    var intent = new Intent(this, typeof(LoginActivity));
                    StartActivity(intent);
                });
                aler.SetNegativeButton("KnowMore", delegate
                {
                    var uri    = Android.Net.Uri.Parse("https://hangoutz.azurewebsites.net/index.html");
                    var intent = new Intent(Intent.ActionView, uri);
                    StartActivity(intent);
                });
                aler.SetNeutralButton("Cancel", delegate
                {
                    var intent = new Intent(this, typeof(Login));
                    StartActivity(intent);
                });
                Dialog dialog1 = aler.Create();
                dialog1.Show();
            }

            try
            {
                propicimage = FindViewById <ImageView>(Resource.Id.user_profile_photo);
                TextView  Name      = FindViewById <TextView>(Resource.Id.user_profile_name);
                TextView  Email     = FindViewById <TextView>(Resource.Id.user_profile_short_bio);
                TextView  Mobile    = FindViewById <TextView>(Resource.Id.user_mobile);
                TextView  Address   = FindViewById <TextView>(Resource.Id.user_Address);
                TextView  PinCode   = FindViewById <TextView>(Resource.Id.user_Zip);
                TextView  Preferrd  = FindViewById <TextView>(Resource.Id.user_Preferred);
                TextView  State     = FindViewById <TextView>(Resource.Id.user_State);
                TextView  Card      = FindViewById <TextView>(Resource.Id.user_Card);
                TextView  Expiry    = FindViewById <TextView>(Resource.Id.User_expiry);
                Button    Drop      = FindViewById <Button>(Resource.Id.drop_down_option_menu);
                ImageView ChangePRo = FindViewById <ImageView>(Resource.Id.add_friend);

                ChangePRo.Click += delegate
                {
                    AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                    aler.SetTitle("Please choose an option to upload profile picture");
                    aler.SetPositiveButton("Gallery", delegate
                    {
                        Intent = new Intent();
                        Intent.SetType("image/*");
                        Intent.SetAction(Intent.ActionGetContent);
                        StartActivityForResult(Intent.CreateChooser(Intent, "Select Picture"), PickImageId);
                    });

                    aler.SetNegativeButton("Camera", delegate
                    {
                        if (IsThereAnAppToTakePictures())
                        {
                            CreateDirectoryForPictures();
                            TakeAPicture();
                        }
                    });
                    aler.SetNeutralButton("Cancel", delegate
                    {
                    });
                    Dialog dialog1 = aler.Create();
                    dialog1.Show();
                };
                // Boolean indirect = true;
                if (indirect == true)
                {
                    System.Threading.Timer timer = null;
                    timer = new System.Threading.Timer((obj) =>
                    {
                        DownloadAsync(this, System.EventArgs.Empty);

                        timer.Dispose();
                    },
                                                       null, 2000, System.Threading.Timeout.Infinite);
                }
                else
                {
                    DownloadAsync(this, System.EventArgs.Empty);
                }
                Drop.Click += (s, arg) =>
                {
                    Intent intent = new Intent(this, typeof(ProfileActivity));
                    ProgressIndicator.Show(this);
                    StartActivity(intent);
                    //PopupMenu menu = new PopupMenu(this, Drop);
                    //menu.Inflate(Resource.Drawable.options_menu_1);
                    //menu.Show();
                };
                string First = output.customer.FirstName;
                string Last  = output.customer.LastName;
                Name.Text = string.Concat(First, Last);
                Card.Text = output.customer.CardNumber.ToString();

                Email.Text = output.customer.Email;

                PinCode.Text  = output.customer.Zip.ToString();
                Preferrd.Text = output.customer.PreferredStore.ToString();
                if (Preferrd.Text == "0")
                {
                    Preferrd.Text = "-Select your preferred store-";
                }
                else if (Preferrd.Text == "1")

                {
                    Preferrd.Text = AppConstants.WallStore;
                }
                else if (Preferrd.Text == "2")
                {
                    Preferrd.Text = AppConstants.PointPleasantStore;
                }
                else
                {
                    Preferrd.Text = AppConstants.SecaucusStore;
                }

                State.Text  = output.customer.State;
                Expiry.Text = output.customer.ExpireDate.ToString();
                string Addres2 = output.customer.Address2;
                string Addres1 = output.customer.Address1;
                Address.Text = string.Concat(Addres1, Addres2);
                string phno1 = output.customer.PhoneNumber;
                string phno2 = output.customer.Phone2;
                if (phno1 != null)
                {
                    Mobile.Text = phno1;
                }
                else
                {
                    Mobile.Text = phno2;
                }
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
            }
            ProgressIndicator.Hide();
        }
コード例 #2
0
 public async override void OnBackPressed()
 {
     MoveTaskToBack(true);
     ProgressIndicator.Hide();
 }
コード例 #3
0
        protected override void OnCreate(Bundle bundle)
        {
            Stopwatch st = new Stopwatch();

            st.Start();
            base.OnCreate(bundle);
            try
            {
                //SetContentView(Resource.Layout.MyFavoriteGridView);
                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);
                if (StoreName == "")
                {
                    StoreName = Intent.GetStringExtra("MyData");
                }
                this.Title = StoreName;
                int              userId = Convert.ToInt32(CurrentUser.getUserId());
                ServiceWrapper   sw     = new ServiceWrapper();
                ItemListResponse output = new ItemListResponse();
                output = sw.GetItemFavsUID(userId).Result;
                List <Item> myArr;
                myArr = output.ItemList.ToList();
                if (output.ItemList.Count == 0)
                {
                    SetContentView(Resource.Layout.FavEmp);
                    TextView  txtName = FindViewById <TextView>(Resource.Id.textView1);
                    ImageView Imag    = FindViewById <ImageView>(Resource.Id.imageView1);
                    //AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                    ////aler.SetTitle("No Reviews Avalilable");
                    //aler.SetMessage("Sorry you didn't tell us your Favourite wines");
                    //LoggingClass.LogInfo("Sorry you didn't tell us your Favourite wines", screenid);
                    //aler.SetNegativeButton("Ok", delegate { Finish(); });
                    //LoggingClass.LogInfo("Clicked on Secaucus", screenid);
                    //Dialog dialog = aler.Create();
                    //dialog.Show();
                }
                else
                {
                    SetContentView(Resource.Layout.MyFavoriteGridView);
                    var gridview = FindViewById <GridView>(Resource.Id.gridviewfav);
                    MyFavoriteAdapter adapter = new MyFavoriteAdapter(this, myArr);
                    LoggingClass.LogInfo("Entered into Favourite Adapter", screenid);
                    gridview.SetNumColumns(2);
                    gridview.Adapter    = adapter;
                    gridview.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
                    {
                        try
                        {
                            string WineBarcode = myArr[args.Position].Barcode;
                            int    storeid     = 1;// myArr[args.Position].PlantFinal;
                            //ProgressIndicator.Show(this);
                            AndHUD.Shared.Show(this, "Loading...", Convert.ToInt32(MaskType.Clear));
                            var intent = new Intent(this, typeof(DetailViewActivity));
                            LoggingClass.LogInfo("Clicked on " + myArr[args.Position].Barcode + " to enter into wine details", screenid);
                            intent.PutExtra("WineBarcode", WineBarcode);
                            intent.PutExtra("storeid", storeid);
                            StartActivity(intent);
                        }
                        catch (Exception)
                        {
                            string WineBarcode = myArr[args.Position].Barcode;
                            int    storeid     = myArr[args.Position].PlantFinal;
                            ProgressIndicator.Show(this);
                            AndHUD.Shared.Dismiss();
                            var intent = new Intent(this, typeof(DetailViewActivity));
                            LoggingClass.LogInfo("Clicked on " + myArr[args.Position].Barcode + " to enter into wine details", screenid);
                            intent.PutExtra("WineBarcode", WineBarcode);
                            intent.PutExtra("storeid", storeid);
                            StartActivity(intent);
                        }
                    };

                    LoggingClass.LogInfo("Entered into My Favorites Activity", screenid);
                }
                st.Stop();
                LoggingClass.LogTime("Favouriteactivity", st.Elapsed.TotalSeconds.ToString());
                ProgressIndicator.Hide();
            }

            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();
            }
        }
コード例 #4
0
        public void CreatePopup(object sender, RatingBar.RatingBarChangeEventArgs e)
        {
            if (CurrentUser.getUserId() == null || CurrentUser.getUserId() == "0")
            {
                AlertDialog.Builder aler = new AlertDialog.Builder(Parent, Resource.Style.MyDialogTheme);
                aler.SetTitle("Sorry");
                aler.SetMessage("This Feature is available for VIP Users only");
                aler.SetNegativeButton("Ok", delegate {
                });
                Dialog dialog1 = aler.Create();
                dialog1.Show();
            }
            else
            {
                try
                {
                    Dialog editDialog = new Dialog(Parent);
                    var    rat        = e.Rating;
                    editDialog.SetContentView(Resource.Layout.EditReviewPopup);
                    ServiceWrapper sw              = new ServiceWrapper();
                    Review         review          = new Review();
                    ImageButton    close           = editDialog.FindViewById <ImageButton>(Resource.Id.close);
                    Button         btnSubmitReview = editDialog.FindViewById <Button>(Resource.Id.btnSubmitReview);
                    TextView       Comments        = editDialog.FindViewById <TextView>(Resource.Id.txtReviewComments);
                    RatingBar      custRating      = editDialog.FindViewById <RatingBar>(Resource.Id.rating);
                    custRating.Rating = rat;
                    Comments.Text     = _editObj.RatingText;
                    int screenid = 9;
                    close.SetScaleType(ImageView.ScaleType.CenterCrop);
                    editDialog.Window.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.Transparent));
                    editDialog.Show();
                    editDialog.SetCanceledOnTouchOutside(false);
                    LoggingClass.LogInfo("Entered into CreatePopup", screenid);

                    close.Click += delegate
                    {
                        LoggingClass.LogInfo("Closed PoPup", screenid);
                        editDialog.Dismiss();
                    };
                    btnSubmitReview.Click += async delegate
                    {
                        AndHUD.Shared.Show(Parent, "Saving Review...", Convert.ToInt32(MaskType.Clear));
                        //  ProgressIndicator.Show(Parent);
                        review.ReviewDate   = DateTime.Now;
                        review.ReviewUserId = Convert.ToInt32(CurrentUser.getUserId());
                        review.Username     = CurrentUser.getUserName();
                        review.RatingText   = Comments.Text;
                        review.RatingStars  = Convert.ToInt32(custRating.Rating);
                        review.IsActive     = true;
                        review.Barcode      = WineBarcode;
                        review.PlantFinal   = storeid;
                        LoggingClass.LogInfo("Submitted review---->" + review.RatingStars + " ---->" + review.RatingText + "---->" + review.PlantFinal + "---->" + review.Barcode, screenid);
                        await sw.InsertUpdateReview(review);

                        ((IPopupParent)Parent).RefreshParent();
                        ProgressIndicator.Hide();
                        editDialog.Dismiss();
                        AndHUD.Shared.Dismiss();
                        AndHUD.Shared.ShowSuccess(Parent, "Sucessfully Saved", MaskType.Clear, TimeSpan.FromSeconds(2));
                    };
                }
                catch (Exception exe)
                {
                    LoggingClass.LogError(exe.Message, ParentScreenId, exe.StackTrace.ToString());
                }
            }
        }
コード例 #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            try
            {
                SetContentView(Resource.Layout.MyFavoriteGridView);
                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);
                if (StoreName == "")
                {
                    StoreName = Intent.GetStringExtra("MyData");
                }
                this.Title = StoreName;

                int StoreId = 0;
                if (StoreName == "My Favorites")
                {
                    StoreId = 1;
                }
                else if (StoreName == "Point Pleasent Store")
                {
                    StoreId = 2;
                }
                else if (StoreName == "Wall Store")
                {
                    StoreId = 3;
                }
                int              userId = Convert.ToInt32(CurrentUser.getUserId());
                ServiceWrapper   sw     = new ServiceWrapper();
                ItemListResponse output = new ItemListResponse();

                output = sw.GetItemFavsUID(userId).Result;


                List <Item> myArr;
                myArr = output.ItemList.ToList();
                var gridview = FindViewById <GridView>(Resource.Id.gridviewfav);
                MyFavoriteAdapter adapter = new MyFavoriteAdapter(this, myArr);
                gridview.SetNumColumns(2);
                gridview.Adapter = adapter;


                gridview.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
                {
                    int WineID = myArr[args.Position].WineId;
                    var intent = new Intent(this, typeof(detailViewActivity));
                    intent.PutExtra("WineID", WineID);
                    StartActivity(intent);
                };
                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();
            }
        }
コード例 #6
0
        protected override void OnCreate(Bundle bundle)
        {
            CheckInternetConnection();
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Profile);
            //st.Start();
            try
            {
                ///LoggingClass.UploadErrorLogs(LoggingClass.CreateDirectoryForLogs());
                LoggingClass.LogInfo("Entered into Profile Activity", screenid);
                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);
                int            userId = Convert.ToInt32(CurrentUser.getUserId());
                ServiceWrapper sw     = new ServiceWrapper();
                var            output = sw.GetCustomerDetails(userId).Result;
                propicimage = FindViewById <ImageView>(Resource.Id.propic);
                DownloadAsync(this, System.EventArgs.Empty);
                //ProfilePicturePickDialog pppd = new ProfilePicturePickDialog();
                //string path = pppd.CreateDirectoryForPictures();
                //string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);

                //var filePath = System.IO.Path.Combine(path + "/" + userId + ".jpg");
                //if (System.IO.File.Exists(filePath))
                //{

                //    Bitmap imageBitmap = BitmapFactory.DecodeFile(filePath);
                //    if (imageBitmap == null)
                //    {
                //        propicimage.SetImageResource(Resource.Drawable.user1);
                //        propicimage.Dispose();
                //    }
                //    else
                //    {
                //        propicimage.SetImageBitmap(imageBitmap);
                //        propicimage.Dispose();
                //    }
                //}
                //else
                //{
                //    Bitmap imageBitmap = BlobWrapper.ProfileImages(userId);
                //    if (imageBitmap == null)
                //    {
                //        propicimage.SetImageResource(Resource.Drawable.user1);
                //    }
                //    else
                //    {
                //        propicimage.SetImageBitmap(imageBitmap);
                //    }
                //}
                InputMethodManager inputManager = (InputMethodManager)this.GetSystemService(Context.InputMethodService);


                ImageButton changepropic = FindViewById <ImageButton>(Resource.Id.btnChangePropic);
                changepropic.Click += delegate
                {
                    LoggingClass.LogInfo("Clicked on change propic", screenid);
                    Intent intent = new Intent(this, typeof(ProfilePicturePickDialog));
                    StartActivity(intent);
                };
                changepropic.Dispose();
                EditText Firstname = FindViewById <EditText>(Resource.Id.txtFirstName);
                Firstname.Text = output.customer.FirstName;
                EditText Lastname = FindViewById <EditText>(Resource.Id.txtLastName);
                Lastname.Text = output.customer.LastName;
                EditText Mobilenumber = FindViewById <EditText>(Resource.Id.txtMobileNumber);
                string   phno1        = output.customer.PhoneNumber;
                string   phno2        = output.customer.Phone2;
                if (phno1 != null)
                {
                    Mobilenumber.Text = phno1;
                }
                else
                {
                    Mobilenumber.Text = phno2;
                }
                EditText Email = FindViewById <EditText>(Resource.Id.txtEmail);

                Email.Text = output.customer.Email;

                EditText Address = FindViewById <EditText>(Resource.Id.txtAddress);
                string   Addres2 = output.customer.Address2;
                string   Addres1 = output.customer.Address1;
                Address.Text = string.Concat(Addres1, Addres2);
                //EditText City = FindViewById<EditText>(Resource.Id.txtCity);
                //City.Text = output.customer.CardNumber;
                //if (CurrentUser.getUserId() != null)
                //{
                //	City.Enabled = false;
                //}
                //else { City.Enabled = true; }
                EditText PinCode = FindViewById <EditText>(Resource.Id.txtZip);


                PinCode.Text = output.customer.Zip;



                Button  updatebtn = FindViewById <Button>(Resource.Id.UpdateButton);
                Spinner spn       = FindViewById <Spinner>(Resource.Id.spinner);
                Spinner Prefered  = FindViewById <Spinner>(Resource.Id.spinner1);
                //spn.SetSelection(4);

                string        state         = output.customer.State;
                int           Preferedstore = output.customer.PreferredStore;
                List <string> storelist     = new List <string>();
                storelist.Add("--select--");
                storelist.Add("Wall");
                storelist.Add("PointPleasent");
                storelist.Add("Both");
                gifImageView = FindViewById <ImageView>(Resource.Id.gifImageView1);
                //gifImageView.StartAnimation();

                List <string> StateList = new List <string>();
                StateList.Add("AL");
                StateList.Add("AK");
                StateList.Add("AZ");
                StateList.Add("AR");
                StateList.Add("CA");
                StateList.Add("CO");
                StateList.Add("CT");
                StateList.Add("DE");
                StateList.Add("FL");
                StateList.Add("GA");
                StateList.Add("HI");
                StateList.Add("ID");
                StateList.Add("IL");
                StateList.Add("IN");
                StateList.Add("IA");
                StateList.Add("KS");
                StateList.Add("KY");
                StateList.Add("LA");
                StateList.Add("ME");
                StateList.Add("MD");
                StateList.Add("MA");
                StateList.Add("MI");
                StateList.Add("MN");
                StateList.Add("MS");
                StateList.Add("MO");
                StateList.Add("MT");
                StateList.Add("NE");
                StateList.Add("NV");
                StateList.Add("NH");
                StateList.Add("NJ");
                StateList.Add("NM");
                StateList.Add("NY");
                StateList.Add("NC");
                StateList.Add("ND");
                StateList.Add("OH");
                StateList.Add("OK");
                StateList.Add("OR");
                StateList.Add("PA");
                StateList.Add("RI");
                StateList.Add("SC");
                StateList.Add("SD");
                StateList.Add("TN");
                StateList.Add("TX");
                StateList.Add("UT");
                StateList.Add("VT");
                StateList.Add("VA");
                StateList.Add("WA");
                StateList.Add("WV");
                StateList.Add("WI");
                StateList.Add("WY");
                int i = StateList.IndexOf(state.ToString());
                spn.SetSelection(i);
                //int p = storelist.IndexOf(Prefered.SelectedItem.ToString());
                Prefered.SetSelection(Preferedstore);
                inputManager.HideSoftInputFromWindow(Firstname.WindowToken, 0);
                inputManager.HideSoftInputFromWindow(Lastname.WindowToken, 0);

                inputManager.HideSoftInputFromWindow(Address.WindowToken, 0);
                inputManager.HideSoftInputFromWindow(PinCode.WindowToken, 0);
                inputManager.HideSoftInputFromWindow(Email.WindowToken, 0);
                if (CurrentUser.getUserId() == null)
                {
                    AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                    aler.SetTitle("Sorry");
                    aler.SetMessage("This feature is available only  for VIP Users");
                    aler.SetNegativeButton("Ok", delegate
                    {
                        var intent = new Intent(this, typeof(TabActivity));
                        StartActivity(intent);
                    });
                    Dialog dialog1 = aler.Create();
                    dialog1.Show();
                }
                else
                {
                    updatebtn.Click += async delegate
                    {
                        if ((Email.Text.Contains("@")) == false || (Email.Text.Contains(".")) == false)
                        {
                            AndHUD.Shared.ShowErrorWithStatus(this, "Email is invalid", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                        else if ((PinCode.Text.Length != 5))
                        {
                            AndHUD.Shared.ShowErrorWithStatus(this, "Zipcode is invalid", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                        else
                        {
                            AndHUD.Shared.Show(this, "Please Wait", Convert.ToInt32(MaskType.Clear));
                            //int p = storelist.IndexOf(Prefered.SelectedItem.ToString());
                            //Prefered.SetSelection(p);
                            Customer customer = new Customer()
                            {
                                FirstName   = Firstname.Text,
                                LastName    = Lastname.Text,
                                PhoneNumber = Mobilenumber.Text,
                                Address1    = Address.Text,
                                Email       = Email.Text,
                                CustomerID  = userId,
                                //State = State.Text,
                                State = spn.SelectedItem.ToString(),

                                //City = City.Text
                                //CardNumber = City.Text,
                                Zip            = PinCode.Text,
                                PreferredStore = Convert.ToInt32(Prefered.SelectedItemId)
                            };
                            CurrentUser.SavePrefered(Convert.ToInt32(Prefered.SelectedItemId));
                            LoggingClass.LogInfo("Clicked on update info", screenid);
                            var x = await sw.UpdateCustomer(customer);

                            if (x == 1)
                            {
                                Toast.MakeText(this, "Thank you your profile is Updated", ToastLength.Short).Show();
                            }
                            AndHUD.Shared.Dismiss();
                            AndHUD.Shared.ShowSuccess(this, "Profile Updated", MaskType.Clear, TimeSpan.FromSeconds(2));
                            //                  var intent = new Intent(this, typeof(TabActivity));
                            //StartActivity(intent);
                        }
                    };
                }
            }
            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("Profile activity", st.Elapsed.TotalSeconds.ToString());
            ProgressIndicator.Hide();
        }
コード例 #7
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View row = convertView;

            if (row == null)
            {
                row = LayoutInflater.From(myContext).Inflate(Resource.Layout.ListView, null, false);
            }
            //else
            //    return row;

            TextView txtName = row.FindViewById <TextView>(Resource.Id.txtName);

            TextView  txtVintage = row.FindViewById <TextView>(Resource.Id.txtVintage);
            TextView  AmountLeft = row.FindViewById <TextView>(Resource.Id.txtAmountLeft);
            TextView  txtPrice   = row.FindViewById <TextView>(Resource.Id.txtPrice);
            ImageView imgWine    = row.FindViewById <ImageView>(Resource.Id.imgWine);
            ImageView buy        = row.FindViewById <ImageView>(Resource.Id.imgHeart1);

            //buy.Click += delegate
            //{
            //    ProgressIndicator.Show(myContext);
            //    var intent = new Intent(myContext, typeof(Wineoutletweb));
            //    intent.PutExtra("WineBarcode", WineBarcode);
            //    StartActivity(intent);
            //};
            ImageView heartImg = row.FindViewById <ImageView>(Resource.Id.imgHeart);
            RatingBar rating   = row.FindViewById <RatingBar>(Resource.Id.rtbProductRating);

            rating.Rating   = (float)myItems[position].AverageRating;
            txtName.Text    = myItems[position].Name;
            txtPrice.Text   = myItems[position].SalePrice.ToString("C", Cultures.UnitedState);
            AmountLeft.Text = "Wine left in bottle: " + myItems[position].AvailableVolume.ToString() + " ml";
            txtVintage.Text = myItems[position].Vintage.ToString();
            if (txtVintage.Text == "0" || txtVintage.Text == null)
            {
                txtVintage.Text = "";
            }
            else
            {
                txtVintage.Text = myItems[position].Vintage.ToString();
            }
            heartImg.SetImageResource(Resource.Drawable.heart_empty);
            //var heartLP = new FrameLayout.LayoutParams(80, 80);
            //var metrics = myContext.Resources.DisplayMetrics;
            //var widthInDp = ConvertPixelsToDp(metrics.WidthPixels);
            //var heightInDp = ConvertPixelsToDp(metrics.HeightPixels);
            //heartLP.LeftMargin = parent.Resources.DisplayMetrics.WidthPixels / 2 - 110; // 110 = 80 + 30
            //heartLP.TopMargin = 5;
            //heartImg.LayoutParameters = heartLP;
            //heartImg.Layout(50, 50, 50, 50);

            bool count = Convert.ToBoolean(myItems[position].IsLike);

            if (count == true)
            {
                heartImg.SetImageResource(Resource.Drawable.heart_full);
            }
            else
            {
                heartImg.SetImageResource(Resource.Drawable.heart_empty);
            }
            heartImg.Tag = position;

            if (convertView == null)
            {
                buy.Click += delegate
                {
                    ProgressIndicator.Show(myContext);
                    var    intent = new Intent(myContext, typeof(Wineoutletweb));
                    string sku    = myItems[position].SKU;
                    intent.PutExtra("sku", sku);
                    intent.PutExtra("Val", "1");
                    myContext.StartActivity(intent);
                };
                heartImg.Click +=
                    delegate
                {
                    if (CurrentUser.GetGuestId() != null || CurrentUser.getUserId() == "0")
                    {
                        AlertDialog.Builder aler = new AlertDialog.Builder(myContext, Resource.Style.MyDialogTheme);
                        aler.SetTitle("Sorry");
                        aler.SetMessage("This Feature is available for VIP Users only");
                        //aler.SetNegativeButton("KnowMore", delegate
                        //{
                        //    var uri = Android.Net.Uri.Parse("https://hangoutz.azurewebsites.net/index.html");
                        //    var intent = new Intent(Intent.ActionView, uri);
                        //    StartActivity(intent);



                        //});
                        aler.SetNegativeButton("Ok", delegate
                        {
                            LoggingClass.LogInfo("Closed PoPup", screenid);
                        });
                        Dialog dialog1 = aler.Create();
                        dialog1.Show();
                    }
                    else
                    {
                        int  actualPosition = Convert.ToInt32(heartImg.Tag);
                        bool x;
                        if (count == false)
                        {
                            heartImg.SetImageResource(Resource.Drawable.heart_full);

                            x     = true;
                            count = true;
                        }
                        else
                        {
                            heartImg.SetImageResource(Resource.Drawable.heart_empty);

                            x     = false;
                            count = false;
                        }
                        var TaskA = new System.Threading.Tasks.Task(async() =>
                        {
                            SKULike like = new SKULike();
                            like.UserID  = Convert.ToInt32(CurrentUser.getUserId());
                            like.SKU     = Convert.ToInt32(myItems[actualPosition].SKU);
                            like.Liked   = x;
                            myItems[actualPosition].IsLike = x;
                            like.BarCode = myItems[actualPosition].Barcode;
                            //LoggingClass.LogInfo("Liked an item", screenid);
                            ServiceWrapper sw = new ServiceWrapper();
                            await sw.InsertUpdateLike(like);
                        });
                        TaskA.Start();
                    }
                };

                // }
            }


            Bitmap imageBitmap;
            string url = myItems[position].SmallImageUrl;

            if (url == null || url == "")
            {
                url = myItems[position].Barcode + ".jpg";
            }
            imageBitmap = BlobWrapper.Bottleimages(url, storeid);
            //var place = new RelativeLayout.LayoutParams(650, 650);

            ////-650 + (parent.Resources.DisplayMetrics.WidthPixels - imageBitmap.Width) / 2;
            //	imgWine.LayoutParameters = place;
            //var place1 = new FrameLayout.LayoutParams(600, 500);

            ////-650 + (parent.Resources.DisplayMetrics.WidthPixels - imageBitmap.Width) / 2;
            //imgWine.LayoutParameters = place1;
            if (imageBitmap != null)
            {
                //		if (heartLP.LeftMargin <= 250)
                //		{
                //			place.LeftMargin = -140;
                float ratio = (float)400 / imageBitmap.Height;
                imageBitmap = Bitmap.CreateScaledBitmap(imageBitmap, Convert.ToInt32(imageBitmap.Width * ratio), 400, true);
                //		}
                //		else
                //		{
                //			place.LeftMargin = -70;
                //			float ratio = (float)650 / imageBitmap.Height;
                //			imageBitmap = Bitmap.CreateScaledBitmap(imageBitmap, Convert.ToInt32(imageBitmap.Width * ratio), 650, true);
                //		}


                imgWine.SetImageBitmap(imageBitmap);
            }
            else
            {
                //if (heartLP.LeftMargin <= 250)
                //{
                //	place.LeftMargin = -140;
                //	imgWine.SetImageResource(Resource.Drawable.bottle);
                //}
                //else
                //{
                //	place.LeftMargin = -70;
                imgWine.SetImageResource(Resource.Drawable.bottle);
            }


            txtName.Focusable    = false;
            AmountLeft.Focusable = false;
            txtVintage.Focusable = false;
            txtPrice.Focusable   = false;
            imgWine.Focusable    = false;
            imgWine.Dispose();
            //imageBitmap.Dispose();
            return(row);
        }
コード例 #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bundle"></param>
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            try
            {
                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" });

                int StoreId = 0;
                if (StoreName == "Wall Store")
                {
                    StoreId = 1;
                }
                else if (StoreName == "Point Pleasant Store")
                {
                    StoreId = 2;
                }
                else
                {
                    StoreId = 3;
                }

                int              userId = Convert.ToInt32(CurrentUser.getUserId());
                ServiceWrapper   sw     = new ServiceWrapper();
                ItemListResponse output = new ItemListResponse();

                output = sw.GetItemList(StoreId, userId).Result;

                SetContentView(Resource.Layout.Main);
                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);
                //var listview = FindViewById<ListView>(Resource.Id.gridview);
                List <Item> myArr;
                //myArr = SampleData();
                myArr = output.ItemList.ToList();

                var gridview = FindViewById <GridView>(Resource.Id.gridview);
                //myArr = SampleData();

                GridViewAdapter adapter = new GridViewAdapter(this, myArr);
                gridview.SetNumColumns(2);
                gridview.Adapter = adapter;

                gridview.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
                {
                    WineID = myArr[args.Position].WineId;
                    //detailViewActivity dva = new detailViewActivity();
                    //dva.downloadAsync(sender, args, WineID);
                    ProgressIndicator.Show(this);
                    var intent = new Intent(this, typeof(detailViewActivity));
                    intent.PutExtra("WineID", WineID);
                    StartActivity(intent);
                    //    ProgressDialog progressdialog = ProgressDialog.Show(this, "Please Wait", "We are loading it");
                    //    new Thread(new ThreadStart(delegate
                    //{
                    //        RunOnUiThread(() => progressdialog.Show());
                    //    Thread.Sleep(10000);


                    //    RunOnUiThread(() => progressdialog.Dismiss());
                    //        //RunOnUiThread(() => progressDialog.Wait(1000));
                    //        //RunOnUiThread(() => progressDialog.Hide());
                    //    })).Start();
                };
                ProgressIndicator.Hide();
            }
            catch (Exception ex)
            {
                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();
            }
        }
コード例 #9
0
ファイル: TabActivity.cs プロジェクト: sammy58492/MyProjects
            public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
            {
                base.OnCreateView(inflater, container, savedInstanceState);
                var    view    = inflater.Inflate(Resource.Layout.LocationLayout, null);
                Button Top     = view.FindViewById <Button>(Resource.Id.btnTop);
                Button Middle  = view.FindViewById <Button>(Resource.Id.btnMiddle);
                Button Bottom  = view.FindViewById <Button>(Resource.Id.btnBottom);
                var    metrics = Resources.DisplayMetrics;
                int    height  = metrics.HeightPixels;

                height = height - (int)((360 * metrics.Density) / 3);
                height = height / 3;
                Top.LayoutParameters.Height    = height;
                Middle.LayoutParameters.Height = height;
                Bottom.LayoutParameters.Height = height;


                if (tabName == "Location")
                {
                    Top.SetBackgroundResource(Resource.Drawable.city);
                    Top.Text = "Wall";
                    Top.SetTextColor(Color.White);
                    Top.TextSize = 20;
                    Middle.SetBackgroundResource(Resource.Drawable.beach);
                    Middle.Text = "Point Pleasant";
                    Middle.SetTextColor(Color.White);
                    Middle.TextSize = 20;
                    Bottom.SetBackgroundResource(Resource.Drawable.city1);
                    Bottom.Text = "Seacucas";
                    Bottom.SetTextColor(Color.White);
                    Bottom.TextSize = 20;



                    Top.Click += (sender, e) =>
                    {
                        ProgressIndicator.Show(_parent);

                        var intent = new Intent(Activity, typeof(GridViewActivity));
                        intent.PutExtra("MyData", "Wall Store");

                        StartActivity(intent);
                    };
                    Middle.Click += (sender, e) =>
                    {
                        ProgressIndicator.Show(_parent);

                        var intent = new Intent(Activity, typeof(GridViewActivity));
                        intent.PutExtra("MyData", "Point Pleasant Store");
                        StartActivity(intent);
                    };
                    Bottom.Click += (sender, e) =>
                    {
                        AlertDialog.Builder aler = new AlertDialog.Builder(Activity);
                        aler.SetTitle("Secacus Store");
                        aler.SetMessage("Coming Soon");
                        aler.SetNegativeButton("Ok", delegate { });
                        Dialog dialog = aler.Create();
                        dialog.Show();
                    };
                }
                if (tabName == "My Hangouts")
                {
                    Top.SetBackgroundResource(Resource.Drawable.winereviews);
                    Top.Text = "My Reviews";
                    Top.SetTextColor(Color.White);
                    Top.TextSize = 20;
                    Middle.SetBackgroundResource(Resource.Drawable.winetasting);
                    Middle.Text = "My Tastings";
                    Middle.SetTextColor(Color.White);
                    Middle.TextSize = 20;
                    Bottom.SetBackgroundResource(Resource.Drawable.myfavorate);
                    Bottom.Text = "My Favorites";
                    Bottom.SetTextColor(Color.White);
                    Bottom.TextSize = 20;

                    Top.Click += (sender, e) =>
                    {
                        ProgressIndicator.Show(_parent);
                        var intent = new Intent(Activity, typeof(MyReviewActivity));
                        intent.PutExtra("MyData", "My Reviews");
                        StartActivity(intent);
                    };
                    Middle.Click += (sender, e) =>
                    {
                        ProgressIndicator.Show(_parent);
                        var intent = new Intent(Activity, typeof(MyTastingActivity));
                        intent.PutExtra("MyData", "My Tastings");
                        StartActivity(intent);
                    };
                    Bottom.Click += (sender, e) =>
                    {
                        ProgressIndicator.Show(_parent);
                        var intent = new Intent(Activity, typeof(MyFavoriteAvtivity));
                        intent.PutExtra("MyData", "My Favorites");
                        StartActivity(intent);
                    };

                    //};
                }
                if (tabName == "Explore")
                {
                    Top.SetBackgroundResource(Resource.Drawable.myprofile);
                    Top.Text = "My Profile";

                    Top.SetTextColor(Color.White);
                    Top.TextSize = 20;


                    Middle.SetBackgroundResource(Resource.Drawable.sfondo_cantine);
                    Middle.Text     = "Wineries/Search Helper";
                    Middle.TextSize = 20;
                    Middle.SetTextColor(Color.White);


                    Bottom.SetBackgroundResource(Resource.Drawable.sfondo_regioni);
                    Bottom.Text     = "Regions";
                    Bottom.TextSize = 20;
                    Bottom.SetTextColor(Color.White);
                    Bottom.SetTextAppearance(Resource.Drawable.abc_btn_borderless_material);

                    Top.Click += (sender, e) =>
                    {
                        ProgressIndicator.Show(_parent);

                        var intent = new Intent(Activity, typeof(ProfileActivity));
                        intent.PutExtra("MyData", "My Profile");
                        StartActivity(intent);
                    };
                    Middle.Click += (sender, e) =>
                    {
                        //AlertDialog.Builder aler = new AlertDialog.Builder(Activity);
                        //aler.SetTitle("Wineries Section");
                        //aler.SetMessage("Coming Soon");
                        //aler.SetNegativeButton("Ok", delegate { });
                        //Dialog dialog = aler.Create();
                        //dialog.Show();
                        var intent = new Intent(Activity, typeof(LandscapeActivity));
                        intent.PutExtra("MyData", "Wineries");
                        StartActivity(intent);
                        //var intent = new Intent(Activity, typeof(AutoCompleteTextActivity));
                        ////intent.PutExtra("MyData", "Wineries");
                        //StartActivity(intent);
                    };
                    Bottom.Click += (sender, e) =>
                    {
                        AlertDialog.Builder aler = new AlertDialog.Builder(Activity);
                        aler.SetTitle("Regions Section");
                        aler.SetMessage("Coming Soon");
                        aler.SetNegativeButton("Ok", delegate { });
                        Dialog dialog = aler.Create();
                        dialog.Show();
                        //var intent = new Intent(Activity, typeof(PotraitActivity));
                        //intent.PutExtra("MyData", "Regions");
                        //StartActivity(intent);
                    };
                }
                //bool isEnabled = Crashes.Enabled;
                //Crashes.Enabled = true;
                //Crashes.GenerateTestCrash();
                //bool didAppCrash = Crashes.HasCrashedInLastSession;
                return(view);
            }
コード例 #10
0
        public async void EmailVerification()
        {
            int count = 0;

            if (count == 0)
            {
                AndHUD.Shared.Show(this, "Checking Email Verification", Convert.ToInt32(MaskType.Clear));
                AuthServ = await svc.AuthencateUser("test", CurrentUser.GetCardNumber(), CurrentUser.GetDeviceID());

                DeviceToken DO = new DeviceToken();
                try
                {
                    DO = await svc.CheckMail(AuthServ.customer.CustomerID.ToString());

                    if (DO.VerificationStatus == 1)
                    {
                        if (AuthServ.customer != null && AuthServ.customer.CustomerID != 0)
                        {
                            LoggingClass.LogInfo("The User logged in with user id: " + CurrentUser.getUserId(), screenid);
                            CurrentUser.SaveUserName(AuthServ.customer.FirstName + AuthServ.customer.LastName, AuthServ.customer.CustomerID.ToString());
                            SendRegistrationToAppServer(CurrentUser.getDeviceToken());
                            CurrentUser.SavePrefered(AuthServ.customer.PreferredStore);
                            int storename = AuthServ.customer.PreferredStore;
                            if (storename == 1)
                            {
                                Intent intent = new Intent(this, typeof(GridViewActivity));
                                intent.PutExtra("MyData", "Wall Store");
                                ProgressIndicator.Show(this);

                                StartActivity(intent);
                            }
                            else if (storename == 2)
                            {
                                Intent intent = new Intent(this, typeof(GridViewActivity));
                                intent.PutExtra("MyData", "Point Pleasant Store");

                                ProgressIndicator.Show(this);
                                StartActivity(intent);
                            }
                            else
                            {
                                Intent intent = new Intent(this, typeof(TabActivity));
                                ProgressIndicator.Show(this);
                                StartActivity(intent);
                            }
                            LoggingClass.LogInfoEx("User verified and Logging" + "---->" + CurrentUser.GetCardNumber(), screenid);
                            AndHUD.Shared.Dismiss();
                            AndHUD.Shared.ShowSuccess(Parent, "Success!", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                        else
                        {
                            int count12 = 0;
                            if (count12 == 0)
                            {
                                AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                                aler.SetTitle("Sorry");
                                aler.SetMessage("You entered wrong details or authentication failed");
                                aler.SetNegativeButton("Ok", delegate { });
                                Dialog dialog1 = aler.Create();
                                dialog1.Show();
                                //   AndHUD.Shared.ShowErrorWithStatus(this, "You entered wrong details or authentication failed", MaskType.Clear, TimeSpan.FromSeconds(2));
                            }
                            count12 = 1;
                        };
                    }
                    else
                    {
                        AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                        //aler.SetTitle("Sorry");
                        aler.SetMessage("Your email is not verified. please check email and verify.");
                        aler.SetNegativeButton("Ok", delegate { });
                        Dialog dialog = aler.Create();
                        dialog.Show();
                        //  AndHUD.Shared.ShowErrorWithStatus(this, "Your email is not verified plesase check email and verify.", MaskType.Clear, TimeSpan.FromSeconds(2));
                    }
                    //ProgressIndicator.Hide();
                    AndHUD.Shared.Dismiss();
                }

                catch (Exception exe)
                {
                    LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                }
                AndHUD.Shared.Dismiss();
            }
            count = 1;
        }
コード例 #11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.detailedView);
            wineid = Intent.GetIntExtra("WineID", 123);
            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ServiceWrapper      svc       = new ServiceWrapper();
            ItemDetailsResponse myData    = new ItemDetailsResponse();
            ItemReviewResponse  SkuRating = new ItemReviewResponse();

            this.Title = "Wine Details";
            var      commentsView = FindViewById <ListView>(Resource.Id.listView2);
            TextView WineName     = FindViewById <TextView>(Resource.Id.txtWineName); //Assigning values to respected Textfields

            WineName.Focusable = false;
            TextView WineProducer = FindViewById <TextView>(Resource.Id.txtProducer);

            WineProducer.Focusable = false;
            TextView Vintage = FindViewById <TextView>(Resource.Id.txtVintage);

            Vintage.Focusable = false;
            TextView WineDescription = FindViewById <TextView>(Resource.Id.txtWineDescription);

            WineDescription.Focusable = false;
            RatingBar AvgRating = FindViewById <RatingBar>(Resource.Id.avgrating);

            AvgRating.Focusable = false;
            TableRow tr5 = FindViewById <TableRow>(Resource.Id.tableRow5);

            try
            {
                downloadAsync(this, System.EventArgs.Empty, wineid);
                myData    = svc.GetItemDetails(wineid).Result;
                SkuRating = svc.GetItemReviewsByWineID(wineid).Result;
                reviewAdapter comments = new reviewAdapter(this, SkuRating.Reviews.ToList());
                commentsView.Adapter = comments;
                setListViewHeightBasedOnChildren1(commentsView);
                WineName.Text        = myData.ItemDetails.Name;
                WineName.InputType   = Android.Text.InputTypes.TextFlagNoSuggestions;
                Vintage.Text         = myData.ItemDetails.Vintage.ToString();
                WineProducer.Text    = myData.ItemDetails.Producer;
                WineDescription.Text = myData.ItemDetails.Description;
                AvgRating.Rating     = (float)myData.ItemDetails.AverageRating;
                Review edit = new Review();
                edit.WineId = wineid;
                ReviewPopup editPopup   = new ReviewPopup(this, edit);
                RatingBar   RatingInput = FindViewById <RatingBar>(Resource.Id.ratingInput);//Taking rating stars input
                RatingInput.RatingBarChange += editPopup.CreatePopup;

                var metrics    = Resources.DisplayMetrics;
                var widthInDp  = ConvertPixelsToDp(metrics.WidthPixels);
                var heightInDp = ConvertPixelsToDp(metrics.HeightPixels);

                //imgWine = FindViewById<ImageView>(Resource.Id.imgWine12);
                HighImageWine = FindViewById <ImageView>(Resource.Id.WineImage);

                //ProfilePicturePickDialog pppd = new ProfilePicturePickDialog();
                //string path = pppd.CreateDirectoryForPictures();
                //var filePath = System.IO.Path.Combine(path + "/" + wineid + ".jpg");
                //if (System.IO.File.Exists(filePath))
                //{
                //    Bitmap imageBitmap = BitmapFactory.DecodeFile(filePath);
                //    imgWine.SetImageBitmap(imageBitmap);
                //}
                //else
                //{
                //    Bitmap imageBitmap = BlobWrapper.Bottleimages(wineid);
                //    imgWine.SetImageBitmap(imageBitmap);
                //}
                //imgWine.LayoutParameters = new RelativeLayout.LayoutParams(1100, 1100);
                BitmapFactory.Options options = new BitmapFactory.Options
                {
                    InJustDecodeBounds = false,
                    OutHeight          = 75,
                    OutWidth           = 75
                };
                ProgressIndicator.Hide();
                Bitmap result = BitmapFactory.DecodeResource(Resources, Resource.Drawable.placeholder_re, options);
            }
            catch (Exception ex)
            {
                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                alert.SetTitle("Sorry");
                alert.SetMessage("We're under maintainence");
                alert.SetNegativeButton("Ok", delegate { });
                Dialog dialog = alert.Create();
                dialog.Show();
            }
            //downloadButton = FindViewById<Button>(Resource.Id.Download);
            //try
            //{
            //    //downloadButton.Enabled = true;
            //    downloadButton.Click += downloadAsync;
            //    //downloadButton.Enabled = false;

            //}

            //catch (Exception e) { }
        }
コード例 #12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            CheckInternetConnection();
            Stopwatch st = new Stopwatch();

            st.Start();
            //for direct login
            //CurrentUser.SaveUserName("Mohana Android","48732");
            //Preinfo("8902519310330");
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.login);
            var TaskA = new System.Threading.Tasks.Task(() =>
            {
                BlobWrapper.DownloadImages(Convert.ToInt32(CurrentUser.getUserId()));
            });

            TaskA.Start();
            ImageButton BtnScanner    = FindViewById <ImageButton>(Resource.Id.btnScanner);
            Button      BtnGuestLogin = FindViewById <Button>(Resource.Id.btnGuestLogin);

            LoggingClass.LogInfo("Opened the app", screenid);

            BtnScanner.Click += async delegate
            {
                try
                {
                    MobileBarcodeScanner.Initialize(Application);
                    var scanner = new ZXing.Mobile.MobileBarcodeScanner();
                    scanner.UseCustomOverlay = false;
                    var result = await scanner.Scan();//"8902519310330";//await scanner.Scan();

                    if (result.Text != null)
                    {
                        LoggingClass.LogInfo("User Tried to login with " + result, screenid);
                        Preinfo(result.Text);
                        CurrentUser.SaveCardNumber(result.Text);
                    }
                }
                catch (Exception exe)
                {
                    LoggingClass.LogError(exe.Message, screenid, exe.StackTrace);
                }
                BtnScanner.Click -= null;
            };

            BtnGuestLogin.Click += async delegate
            {
                //await svc.InsertUpdateGuest(CurrentUser.getAuthToken());
                CurrentUser.SaveUserName("Guest", "0");


                Intent intent = new Intent(this, typeof(TabActivity));
                ProgressIndicator.Show(this);
                LoggingClass.LogInfo("User Tried to login with Guest Login ", screenid);
                StartActivity(intent);
                await svc.InsertUpdateGuest("Didn't get the token");
            };
            TxtScanresult             = FindViewById <TextView>(Resource.Id.txtScanresult);
            BtnLogin                  = FindViewById <Button>(Resource.Id.btnLogin);
            BtnResend                 = FindViewById <Button>(Resource.Id.btnResend);
            BtnContinue               = FindViewById <Button>(Resource.Id.btnContinue);
            BtnUpdateEmail            = FindViewById <Button>(Resource.Id.btnUpdateEmail);
            BtnResend.Visibility      = ViewStates.Invisible;
            BtnLogin.Visibility       = ViewStates.Invisible;
            BtnContinue.Visibility    = ViewStates.Invisible;
            BtnUpdateEmail.Visibility = ViewStates.Invisible;
            if (IsPlayServicesAvailable())
            {
                var TaskB = new System.Threading.Tasks.Task(() =>
                {
                    var intent = new Intent(this, typeof(RegistrationIntentService));
                    StartService(intent);
                });
                TaskB.Start();
            }
            if (CurrentUser.getUserName() == null ||
                CurrentUser.getUserName() == "")
            {
                SendRegistrationToAppServer(CurrentUser.getDeviceToken());
                if (CurrentUser.GetCardNumber() != null)
                {
                    Preinfo(CurrentUser.GetCardNumber());
                }
            }
            else if (CurrentUser.GetGuestId() != null || CurrentUser.getUserId() == "0")
            {
                Intent intent = new Intent(this, typeof(TabActivity));
                ProgressIndicator.Show(this);
                LoggingClass.LogInfo("User Tried to login with Guest Login ", screenid);
                StartActivity(intent);
            }
            else
            {
                int storename = Convert.ToInt32(CurrentUser.GetPrefered());
                if (storename == 1)
                {
                    Intent intent = new Intent(this, typeof(GridViewActivity));
                    intent.PutExtra("MyData", "Wall Store");
                    ProgressIndicator.Show(this);
                    StartActivity(intent);
                }
                else if (storename == 2)
                {
                    Intent intent = new Intent(this, typeof(GridViewActivity));
                    intent.PutExtra("MyData", "Point Pleasant Store");
                    ProgressIndicator.Show(this);
                    StartActivity(intent);
                }
                else
                {
                    Intent intent = new Intent(this, typeof(TabActivity));
                    ProgressIndicator.Show(this);
                    StartActivity(intent);
                }
            }
            var telephonyDeviceID             = string.Empty;
            var telephonySIMSerialNumber      = string.Empty;
            TelephonyManager telephonyManager = (TelephonyManager)this.ApplicationContext.GetSystemService(Context.TelephonyService);

            if (telephonyManager != null)
            {
                if (!string.IsNullOrEmpty(telephonyManager.DeviceId))
                {
                    telephonyDeviceID = telephonyManager.DeviceId;
                }
                if (!string.IsNullOrEmpty(telephonyManager.SimSerialNumber))
                {
                    telephonySIMSerialNumber = telephonyManager.SimSerialNumber;
                }
            }
            var androidID  = Android.Provider.Settings.Secure.GetString(this.ApplicationContext.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
            var deviceUuid = new UUID(androidID.GetHashCode(), ((long)telephonyDeviceID.GetHashCode() << 32) | telephonySIMSerialNumber.GetHashCode());
            var DeviceID   = deviceUuid.ToString();

            CurrentUser.SaveDeviceID(DeviceID);
        }
コード例 #13
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);


            SetContentView(Resource.Layout.Hangouts);
            Button Top     = FindViewById <Button>(Resource.Id.btnTop);
            Button Middle  = FindViewById <Button>(Resource.Id.btnMiddle);
            Button Bottom  = FindViewById <Button>(Resource.Id.btnBottom);
            Button Bottom1 = FindViewById <Button>(Resource.Id.btnBottom1);
            var    metrics = Resources.DisplayMetrics;
            int    height  = 0;// = metrics.HeightPixels;

            height = (metrics.HeightPixels) - (int)((360 * metrics.Density) / 3);
            height = height / 4;
            height = height - 10;
            Top.LayoutParameters.Height     = height;
            Middle.LayoutParameters.Height  = height;
            Bottom.LayoutParameters.Height  = height;
            Bottom1.LayoutParameters.Height = height;
            Top.SetBackgroundResource(Resource.Drawable.mt);
            Middle.SetBackgroundResource(Resource.Drawable.mr);
            Bottom.SetBackgroundResource(Resource.Drawable.mf);
            Bottom1.SetBackgroundResource(Resource.Drawable.ms);
            if (CurrentUser.getUserId() == null || CurrentUser.getUserId() == "0")
            {
                AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                aler.SetTitle("Sorry");
                aler.SetMessage("This Feature is available only for VIP Users ");
                aler.SetNegativeButton("KnowMore", delegate
                {
                    var uri    = Android.Net.Uri.Parse("https://hangoutz.azurewebsites.net/index.html");
                    var intent = new Intent(Intent.ActionView, uri);
                    StartActivity(intent);
                });
                aler.SetNeutralButton("Cancel", delegate
                {
                });
                Dialog dialog1 = aler.Create();
                dialog1.Show();
                Top.Click += (sender, e) =>
                {
                    Dialog dialog11 = aler.Create();
                    dialog1.Show();
                };
                Middle.Click += (sender, e) =>
                {
                    Dialog dialog12 = aler.Create();
                    dialog1.Show();
                };
                Bottom.Click += (sender, e) =>
                {
                    Dialog dialog13 = aler.Create();
                    dialog1.Show();
                };
                Bottom1.Click += (sender, e) =>
                {
                    Dialog dialog13 = aler.Create();
                    dialog1.Show();
                };
            }
            else
            {
                Top.Click += (sender, e) =>
                {
                    ProgressIndicator.Show(this);
                    var intent = new Intent(this, typeof(MyTastingActivity));
                    intent.PutExtra(AppConstants.MyData, AppConstants.MyTastings);
                    StartActivity(intent);
                };
                Middle.Click += (sender, e) =>
                {
                    ProgressIndicator.Show(this);
                    var intent = new Intent(this, typeof(MyReviewActivity));
                    intent.PutExtra(AppConstants.MyData, AppConstants.MyReviews);
                    StartActivity(intent);
                };
                Bottom.Click += (sender, e) =>
                {
                    ProgressIndicator.Show(this);
                    var intent = new Intent(this, typeof(MyFavoriteAvtivity));
                    intent.PutExtra(AppConstants.MyData, AppConstants.MyFavorites);
                    StartActivity(intent);
                };
                Bottom1.Click += (sender, e) =>
                {
                    CustomerResponse AuthServ = new CustomerResponse();
                    int storename             = Convert.ToInt32(CurrentUser.GetPrefered());
                    if (storename == 1)
                    {
                        Intent intent = new Intent(this, typeof(GridViewActivity));
                        intent.PutExtra(AppConstants.MyData, AppConstants.WallStore);
                        ProgressIndicator.Show(this);

                        StartActivity(intent);
                    }
                    else if (storename == 2)
                    {
                        Intent intent = new Intent(this, typeof(GridViewActivity));
                        intent.PutExtra(AppConstants.MyData, AppConstants.PointPleasantStore);
                        ProgressIndicator.Show(this);
                        StartActivity(intent);
                    }
                    else if (storename == 3)
                    {
                        Intent intent = new Intent(this, typeof(GridViewActivity));
                        intent.PutExtra(AppConstants.MyData, AppConstants.SecaucusStore);
                        ProgressIndicator.Show(this);
                        StartActivity(intent);
                    }
                    else
                    {
                        AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                        aler.SetMessage("Please Select your preferred store!");
                        aler.SetNegativeButton("Ok", delegate { });
                        Dialog dialog1 = aler.Create();
                        dialog1.Show();
                    }
                };
            }
        }
コード例 #14
0
        protected override void OnCreate(Bundle bundle)
        {
            CheckInternetConnection();
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Profile);
            //st.Start();
            try
            {
                ///LoggingClass.UploadErrorLogs(LoggingClass.CreateDirectoryForLogs());
                LoggingClass.LogInfo("Entered into Profile Activity", screenid);
                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);
                int            userId = Convert.ToInt32(CurrentUser.getUserId());
                ServiceWrapper sw     = new ServiceWrapper();
                var            output = sw.GetCustomerDetails(userId).Result;
                propicimage = FindViewById <ImageView>(Resource.Id.propic);
                //propicimage.SetImageResource(Resource.Drawable.ProfileEmpty);
                propicimage.SetImageResource(Resource.Drawable.Loading);
                RefreshParent();
                if (indirect == true)
                {
                    System.Threading.Timer timer = null;
                    timer = new System.Threading.Timer((obj) =>
                    {
                        DownloadAsync(this, System.EventArgs.Empty);
                        timer.Dispose();
                    },
                                                       null, 4000, System.Threading.Timeout.Infinite);
                }
                else
                {
                    DownloadAsync(this, System.EventArgs.Empty);
                }
                // DownloadAsync(this, System.EventArgs.Empty);

                ImageButton changepropic = FindViewById <ImageButton>(Resource.Id.btnChangePropic);
                changepropic.Click += delegate
                {
                    LoggingClass.LogInfo("Clicked on change propic", screenid);
                    Intent intent = new Intent(this, typeof(ProfilePicturePickDialog));
                    StartActivity(intent);
                };
                changepropic.Dispose();
                EditText Firstname    = FindViewById <EditText>(Resource.Id.txtFirstName);
                Button   updatebtn    = FindViewById <Button>(Resource.Id.UpdateButton);
                Spinner  spn          = FindViewById <Spinner>(Resource.Id.spinner);
                Spinner  Prefered     = FindViewById <Spinner>(Resource.Id.spinner1);
                TextView card         = FindViewById <TextView>(Resource.Id.txtcard1);
                TextView exp          = FindViewById <TextView>(Resource.Id.txtexp);
                EditText Mobilenumber = FindViewById <EditText>(Resource.Id.txtMobileNumber);
                EditText Lastname     = FindViewById <EditText>(Resource.Id.txtLastName);
                EditText Email        = FindViewById <EditText>(Resource.Id.txtEmail);
                EditText Address      = FindViewById <EditText>(Resource.Id.txtAddress);
                EditText PinCode      = FindViewById <EditText>(Resource.Id.txtZip);
                if (CurrentUser.GetGuestId() != null || CurrentUser.getUserId() == "0")
                {
                    AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                    aler.SetTitle("Sorry");
                    aler.SetMessage("This feature is available only  for VIP Users");
                    aler.SetPositiveButton("Login", delegate
                    {
                        var intent = new Intent(this, typeof(LoginActivity));
                        StartActivity(intent);
                    });
                    aler.SetNegativeButton("KnowMore", delegate
                    {
                        var uri    = Android.Net.Uri.Parse("https://hangoutz.azurewebsites.net/index.html");
                        var intent = new Intent(Intent.ActionView, uri);
                        StartActivity(intent);
                    });
                    aler.SetNeutralButton("Cancel", delegate
                    {
                        var intent = new Intent(this, typeof(TabActivity));
                        StartActivity(intent);
                    });
                    Dialog dialog1 = aler.Create();
                    dialog1.Show();
                }
                else
                {
                    Firstname.Text = output.customer.FirstName;

                    Firstname.FocusableInTouchMode = false;
                    Firstname.Click += delegate {
                        Firstname.FocusableInTouchMode = true;
                    };


                    card.Text = output.customer.CardNumber;

                    exp.Text = output.customer.ExpireDate.ToString();
                    if (exp.Text == null || exp.Text == "")
                    {
                        exp.Text = "--";
                    }
                    else
                    {
                        exp.Text = output.customer.ExpireDate.ToString("yyyy/MM/dd");
                    }


                    Lastname.Text = output.customer.LastName;
                    Lastname.FocusableInTouchMode = false;
                    Lastname.Click += delegate {
                        Lastname.FocusableInTouchMode = true;
                    };

                    Mobilenumber.FocusableInTouchMode = false;
                    string phno1 = output.customer.PhoneNumber;
                    string phno2 = output.customer.Phone2;
                    if (phno1 != null)
                    {
                        Mobilenumber.Text = phno1;
                    }
                    else
                    {
                        Mobilenumber.Text = phno2;
                    }
                    Mobilenumber.Click += delegate {
                        Mobilenumber.FocusableInTouchMode = true;
                    };


                    Email.Text = output.customer.Email;
                    Email.FocusableInTouchMode = false;
                    Email.Click += delegate {
                        Email.FocusableInTouchMode = true;
                    };


                    string Addres2 = output.customer.Address2;
                    string Addres1 = output.customer.Address1;
                    Address.Text = string.Concat(Addres1, Addres2);
                    Address.FocusableInTouchMode = false;
                    Address.Click += delegate {
                        Address.FocusableInTouchMode = true;
                    };
                    //EditText City = FindViewById<EditText>(Resource.Id.txtCity);
                    //City.Text = output.customer.CardNumber;
                    //if (CurrentUser.getUserId() != null)
                    //{
                    //	City.Enabled = false;
                    //}
                    //else { City.Enabled = true; }

                    PinCode.Text = output.customer.Zip;
                    PinCode.FocusableInTouchMode = false;
                    PinCode.Click += delegate {
                        PinCode.FocusableInTouchMode = true;
                    };

                    //spn.SetSelection(4);

                    string        state         = output.customer.State;
                    int           Preferedstore = output.customer.PreferredStore;
                    List <string> storelist     = new List <string>();
                    storelist.Add("--Select your preferred store--");
                    storelist.Add("Wall");
                    storelist.Add("Point Pleasant");
                    storelist.Add("All");
                    gifImageView = FindViewById <ImageView>(Resource.Id.gifImageView1);
                    //gifImageView.StartAnimation();

                    List <string> StateList = new List <string>();
                    StateList.Add("AL");
                    StateList.Add("AK");
                    StateList.Add("AZ");
                    StateList.Add("AR");
                    StateList.Add("CA");
                    StateList.Add("CO");
                    StateList.Add("CT");
                    StateList.Add("DE");
                    StateList.Add("FL");
                    StateList.Add("GA");
                    StateList.Add("HI");
                    StateList.Add("ID");
                    StateList.Add("IL");
                    StateList.Add("IN");
                    StateList.Add("IA");
                    StateList.Add("KS");
                    StateList.Add("KY");
                    StateList.Add("LA");
                    StateList.Add("ME");
                    StateList.Add("MD");
                    StateList.Add("MA");
                    StateList.Add("MI");
                    StateList.Add("MN");
                    StateList.Add("MS");
                    StateList.Add("MO");
                    StateList.Add("MT");
                    StateList.Add("NE");
                    StateList.Add("NV");
                    StateList.Add("NH");
                    StateList.Add("NJ");
                    StateList.Add("NM");
                    StateList.Add("NY");
                    StateList.Add("NC");
                    StateList.Add("ND");
                    StateList.Add("OH");
                    StateList.Add("OK");
                    StateList.Add("OR");
                    StateList.Add("PA");
                    StateList.Add("RI");
                    StateList.Add("SC");
                    StateList.Add("SD");
                    StateList.Add("TN");
                    StateList.Add("TX");
                    StateList.Add("UT");
                    StateList.Add("VT");
                    StateList.Add("VA");
                    StateList.Add("WA");
                    StateList.Add("WV");
                    StateList.Add("WI");
                    StateList.Add("WY");
                    int i = StateList.IndexOf(state.ToString());
                    spn.SetSelection(i);
                    //int p = storelist.IndexOf(Prefered.SelectedItem.ToString());
                    Prefered.SetSelection(Preferedstore);


                    updatebtn.Click += async delegate
                    {
                        if ((Email.Text.Contains("@")) == false || (Email.Text.Contains(".")) == false)
                        {
                            AndHUD.Shared.ShowErrorWithStatus(this, "Email is invalid", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                        else if ((PinCode.Text.Length != 5))
                        {
                            AndHUD.Shared.ShowErrorWithStatus(this, "Zipcode is invalid", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                        else
                        {
                            AndHUD.Shared.Show(this, "Please Wait...", Convert.ToInt32(MaskType.Clear));

                            Customer customer = new Customer()
                            {
                                FirstName   = Firstname.Text,
                                LastName    = Lastname.Text,
                                PhoneNumber = Mobilenumber.Text,
                                Address1    = Address.Text,
                                Email       = Email.Text,
                                CustomerID  = userId,
                                //State = State.Text,
                                State = spn.SelectedItem.ToString(),

                                //City = City.Text
                                //CardNumber = City.Text,
                                Zip            = PinCode.Text,
                                PreferredStore = Convert.ToInt32(Prefered.SelectedItemId)
                            };
                            CurrentUser.SavePrefered(Convert.ToInt32(Prefered.SelectedItemId));
                            LoggingClass.LogInfo("Clicked on update info", screenid);
                            var x = await sw.UpdateCustomer(customer);

                            if (x == 1)
                            {
                                // Toast.MakeText(this, "Thank you your profile is Updated", ToastLength.Short).Show();
                            }
                            AndHUD.Shared.Dismiss();
                            AndHUD.Shared.ShowSuccess(this, "Profile Updated", MaskType.Clear, TimeSpan.FromSeconds(2));
                            //StartActivity(intent);
                        }
                    };
                }
            }
            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();
            }

            ProgressIndicator.Hide();
        }
コード例 #15
0
        public void Internal_ViewDidLoad()
        {
            try
            {
                WineBarcode = Intent.GetStringExtra("WineBarcode");
                storeid     = 1;//Intent.GetIntExtra("storeid", 1);
                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);
                ServiceWrapper svc = new ServiceWrapper();
                myData = new ItemDetailsResponse();
                ItemReviewResponse SkuRating = new ItemReviewResponse();
                this.Title = "Wine Details";
                try
                {
                    DownloadAsync(this, System.EventArgs.Empty, WineBarcode);
                    myData      = svc.GetItemDetails(WineBarcode, 1).Result;
                    SkuRating   = svc.GetItemReviewsByWineBarcode(WineBarcode).Result;
                    ReviewArray = SkuRating.Reviews.ToList();
                    var tempReview = SkuRating.Reviews.ToList().Find(x => x.ReviewUserId == Convert.ToInt32(CurrentUser.getUserId()));
                    if (tempReview != null)
                    {
                        editPopup._editObj.RatingText = tempReview.RatingText;
                    }
                    comments = new reviewAdapter(this, ReviewArray);
                    if (comments.Count == 0)
                    {
                        ErrorDescription.Visibility = ViewStates.Visible;
                        ErrorDescription.Text       = SkuRating.ErrorDescription;
                        ErrorDescription.SetTextColor(Android.Graphics.Color.Black);
                    }
                    else
                    {
                        commentsview.Adapter = comments;
                    }
                    setListViewHeightBasedOnChildren1(commentsview);
                    WineName.Text = myData.ItemDetails.Name;

                    WineName.InputType = Android.Text.InputTypes.TextFlagNoSuggestions;
                    Vintage.Text       = myData.ItemDetails.Vintage.ToString();
                    if (Vintage.Text == null || Vintage.Text == "0")
                    {
                        Vintage.Text = "";
                    }
                    else
                    {
                        Vintage.Text = myData.ItemDetails.Vintage.ToString();
                    }
                    if (myData.ItemDetails.Producer == null || myData.ItemDetails.Producer == "")
                    {
                        WineProducer.Text = "Not Available";
                    }
                    else
                    {
                        WineProducer.Text = myData.ItemDetails.Producer;
                    }
                    if (myData.ItemDetails.Description == null || myData.ItemDetails.Description == "")
                    {
                        WineDescription.Text = "Not Available";
                    }
                    else
                    {
                        WineDescription.Text = myData.ItemDetails.Description;
                    }
                    AvgRating.Rating = (float)myData.ItemDetails.AverageRating;

                    //ReviewPopup editPopup = new ReviewPopup(this, edit);
                    //RatingBar RatingInput = FindViewById<RatingBar>(Resource.Id.ratingInput);//Taking rating stars input
                    //RatingInput.RatingBarChange += editPopup.CreatePopup;

                    var metrics    = Resources.DisplayMetrics;
                    var widthInDp  = ConvertPixelsToDp(metrics.WidthPixels);
                    var heightInDp = ConvertPixelsToDp(metrics.HeightPixels);


                    HighImageWine = FindViewById <ImageView>(Resource.Id.WineImage);

                    BitmapFactory.Options options = new BitmapFactory.Options
                    {
                        InJustDecodeBounds = false,
                        OutHeight          = 75,
                        OutWidth           = 75
                    };
                    // ProgressIndicator.Hide();
                    LoggingClass.LogInfo("Entered into detail view" + WineBarcode, screenid);
                    // Bitmap result = BitmapFactory.DecodeResource(Resources, Resource.Drawable.placeholder_re, options);
                }
                catch (Exception exe)
                {
                    LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                    AlertDialog.Builder alert = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                    alert.SetTitle("Sorry");
                    alert.SetMessage("We're under maintainence");
                    alert.SetNegativeButton("Ok", delegate { });
                    Dialog dialog = alert.Create();
                    dialog.Show();
                    try
                    {
                        ProgressIndicator.Hide();
                    }
                    catch (Exception exe1)
                    {
                        LoggingClass.LogError(exe1.Message, screenid, exe1.StackTrace.ToString());
                    }
                }
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
            }
        }
コード例 #16
0
            public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
            {
                Stopwatch sr = new Stopwatch();;

                sr.Start();
                base.OnCreateView(inflater, container, savedInstanceState);
                var    view    = inflater.Inflate(Resource.Layout.LocationLayout, null);
                Button Top     = view.FindViewById <Button>(Resource.Id.btnTop);
                Button Middle  = view.FindViewById <Button>(Resource.Id.btnMiddle);
                Button Bottom  = view.FindViewById <Button>(Resource.Id.btnBottom);
                var    metrics = Resources.DisplayMetrics;
                int    height  = metrics.HeightPixels;

                height = height - (int)((360 * metrics.Density) / 3);
                height = height / 3;
                height = height + 2;
                Top.LayoutParameters.Height    = height;
                Middle.LayoutParameters.Height = height;
                Bottom.LayoutParameters.Height = height;


                if (tabName == "Locations")
                {
                    LoggingClass.LogInfo("Clicked on " + tabName, screenid);

                    try
                    {
                        Top.SetBackgroundResource(Resource.Drawable.wall1);
                        //Top.Text = "Wall";
                        //Top.SetTextColor(Color.White);
                        // Top.TextSize = 20;
                        Middle.SetBackgroundResource(Resource.Drawable.pp1);
                        //Middle.Text = "Pt. Pleasant Beach";
                        //Middle.SetTextColor(Color.White);
                        // Middle.TextSize = 20;
                        Bottom.SetBackgroundResource(Resource.Drawable.scacus1);
                        //Bottom.Text = "Secaucus";
                        //Bottom.SetTextColor(Color.White);
                        // Bottom.TextSize = 20;
                        OnPause(); { }
                        Top.Click += (sender, e) =>
                        {
                            ProgressIndicator.Show(_parent);
                            LoggingClass.LogInfo("Clicked on Wall", screenid);
                            var intent = new Intent(Activity, typeof(GridViewActivity));
                            intent.PutExtra("MyData", "Wall Store");

                            StartActivity(intent);
                        };
                        Middle.Click += (sender, e) =>
                        {
                            ProgressIndicator.Show(_parent);
                            LoggingClass.LogInfo("Clicked on Point Plesent", screenid);
                            var intent = new Intent(Activity, typeof(GridViewActivity));
                            intent.PutExtra("MyData", "Point Pleasant Store");
                            StartActivity(intent);
                        };
                        Bottom.Click += (sender, e) =>
                        {
                            AlertDialog.Builder aler = new AlertDialog.Builder(Activity);
                            aler.SetTitle("Secaucus Store");
                            aler.SetMessage("Coming Soon!");
                            aler.SetNegativeButton("Ok", delegate { });
                            LoggingClass.LogInfo("Clicked on Secaucus", screenid);
                            Dialog dialog = aler.Create();
                            dialog.Show();
                        };
                    }
                    catch (Exception exe)
                    {
                        LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                    }
                }
                if (tabName == "My Hangouts")
                {
                    LoggingClass.LogInfo("Clicked on " + tabName, screenid);
                    try
                    {
                        Button Bottom1 = view.FindViewById <Button>(Resource.Id.btnBottom1);
                        int    height1 = metrics.HeightPixels;
                        height1 = height1 - (int)((360 * metrics.Density) / 4);
                        height1 = height1 / 4;
                        height1 = height1 - 20;
                        Top.LayoutParameters.Height     = height1;
                        Middle.LayoutParameters.Height  = height1;
                        Bottom.LayoutParameters.Height  = height1;
                        Bottom1.LayoutParameters.Height = height1;

                        Top.SetBackgroundResource(Resource.Drawable.mt);
                        //Top.Text = "My Reviews";
                        //Top.SetTextColor(Color.White);
                        //Top.TextSize = 20;
                        Middle.SetBackgroundResource(Resource.Drawable.mr);
                        //Middle.Text = "My Tastings";
                        //Middle.SetTextColor(Color.White);
                        //Middle.TextSize = 20;
                        Bottom.SetBackgroundResource(Resource.Drawable.mf);
                        Bottom1.SetBackgroundResource(Resource.Drawable.ms);
                        //Bottom.Text = "My Favorites";
                        //Bottom.SetTextColor(Color.White);
                        //Bottom.TextSize = 20;
                        if (CurrentUser.getUserId() == "0" || CurrentUser.GetGuestId() != null)
                        {
                            AlertDialog.Builder aler = new AlertDialog.Builder(Activity, Resource.Style.MyDialogTheme);
                            aler.SetTitle("Sorry");
                            aler.SetMessage("This Feature is available for VIP Users only");
                            aler.SetPositiveButton("Login", delegate
                            {
                                var intent = new Intent(Activity, typeof(LoginActivity));
                                StartActivity(intent);
                            });
                            aler.SetNegativeButton("KnowMore", delegate
                            {
                                var uri    = Android.Net.Uri.Parse("https://hangoutz.azurewebsites.net/index.html");
                                var intent = new Intent(Intent.ActionView, uri);
                                StartActivity(intent);
                            });
                            aler.SetNeutralButton("Cancel", delegate
                            {
                            });
                            Dialog dialog1 = aler.Create();
                            dialog1.Show();
                            Top.Click += (sender, e) => {
                                Dialog dialog11 = aler.Create();
                                dialog1.Show();
                            };
                            Middle.Click += (sender, e) => {
                                Dialog dialog12 = aler.Create();
                                dialog1.Show();
                            };
                            Bottom.Click += (sender, e) => {
                                Dialog dialog13 = aler.Create();
                                dialog1.Show();
                            };
                            Bottom1.Click += (sender, e) => {
                                Dialog dialog13 = aler.Create();
                                dialog1.Show();
                            };
                        }
                        else
                        {
                            Top.Click += (sender, e) =>
                            {
                                ProgressIndicator.Show(_parent);
                                // AndHUD.Shared.Show(_parent, "Loading...", Convert.ToInt32(MaskType.Clear));
                                LoggingClass.LogInfo("Clicked on My Reviews", screenid);
                                var intent = new Intent(Activity, typeof(MyTastingActivity));
                                intent.PutExtra("MyData", "My Reviews");
                                StartActivity(intent);
                            };
                            Middle.Click += (sender, e) =>
                            {
                                ProgressIndicator.Show(_parent);
                                LoggingClass.LogInfo("Clicked on My Tastings", screenid);
                                var intent = new Intent(Activity, typeof(MyReviewActivity));
                                intent.PutExtra("MyData", "My Tastings");
                                StartActivity(intent);
                            };
                            Bottom.Click += (sender, e) =>
                            {
                                ProgressIndicator.Show(_parent);
                                LoggingClass.LogInfo("Clicked on My Favorites", screenid);
                                var intent = new Intent(Activity, typeof(MyFavoriteAvtivity));
                                intent.PutExtra("MyData", "My Favorites");
                                StartActivity(intent);
                            };
                            Bottom1.Click += (sender, e) =>
                            {
                                //ProgressIndicator.Show(_parent);
                                LoggingClass.LogInfo("Clicked on My Store", screenid);
                                CustomerResponse AuthServ = new CustomerResponse();
                                int storename             = Convert.ToInt32(CurrentUser.GetPrefered());
                                if (storename == 1)
                                {
                                    Intent intent = new Intent(Activity, typeof(GridViewActivity));
                                    intent.PutExtra("MyData", "Wall Store");
                                    ProgressIndicator.Show(Activity);

                                    StartActivity(intent);
                                }
                                else if (storename == 2)
                                {
                                    Intent intent = new Intent(Activity, typeof(GridViewActivity));
                                    intent.PutExtra("MyData", "Point Pleasant Store");

                                    ProgressIndicator.Show(Activity);
                                    StartActivity(intent);
                                }
                                else
                                {
                                    AlertDialog.Builder aler = new AlertDialog.Builder(Activity, Resource.Style.MyDialogTheme);
                                    //aler.SetTitle("Sorry");
                                    aler.SetMessage("Please Select your preferred store!");
                                    aler.SetNegativeButton("Ok", delegate { });
                                    Dialog dialog1 = aler.Create();
                                    dialog1.Show();
                                }
                            };
                        }
                    }
                    catch (Exception exe)
                    {
                        LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                    }

                    //};
                }
                if (tabName == "Explore")
                {
                    try
                    {
                        //Top.SetBackgroundResource(Resource.Drawable.myprofile);
                        //Top.Text = "My Profile";
                        //Top.SetTextColor(Color.White);
                        //Top.TextSize = 20;
                        //Middle.SetBackgroundResource(Resource.Drawable.sfondo_cantine);
                        //Middle.Text = "Wineries/Search Helper";
                        //Middle.TextSize = 20;
                        //Middle.SetTextColor(Color.White);
                        //Bottom.SetBackgroundResource(Resource.Drawable.sfondo_regioni);
                        //Bottom.Text = "Regions";
                        //Bottom.TextSize = 20;
                        //Bottom.SetTextColor(Color.White);
                        //Bottom.SetTextAppearance(Resource.Drawable.abc_btn_borderless_material);

                        //Top.Click += (sender, e) =>
                        //{

                        //    ProgressIndicator.Show(_parent);
                        //    LoggingClass.LogInfo("Clicked on My Profile",screenid);
                        //    var intent = new Intent(Activity, typeof(ProfileActivity));
                        //    intent.PutExtra("MyData", "My Profile");
                        //    StartActivity(intent);

                        //};
                        //Middle.Click += (sender, e) =>
                        //{
                        //    AlertDialog.Builder aler = new AlertDialog.Builder(Activity, Resource.Style.MyDialogTheme);
                        //    aler.SetTitle("Wineries Section");
                        //    aler.SetMessage("Coming Soon");
                        //    aler.SetNegativeButton("Ok", delegate { });
                        //    LoggingClass.LogInfo("Clicked on Wineries",screenid);
                        //    Dialog dialog = aler.Create();
                        //    dialog.Show();
                        //    //var intent = new Intent(Activity, typeof(LandscapeActivity));
                        //    //    intent.PutExtra("MyData", "Wineries");
                        //    //    StartActivity(intent);
                        //    //var intent = new Intent(Activity, typeof(AutoCompleteTextActivity));
                        //    ////intent.PutExtra("MyData", "Wineries");
                        //    //StartActivity(intent);
                        //};
                        //Bottom.Click += (sender, e) =>
                        //{
                        //    AlertDialog.Builder aler = new AlertDialog.Builder(Activity, Resource.Style.MyDialogTheme);
                        //    aler.SetTitle("Regions Section");
                        //    aler.SetMessage("Coming Soon");
                        //    aler.SetNegativeButton("Ok", delegate { });
                        //    LoggingClass.LogInfo("Clicked on Regions",screenid);
                        //    Dialog dialog = aler.Create();
                        //    dialog.Show();
                        //    //var intent = new Intent(Activity, typeof(PotraitActivity));
                        //    //intent.PutExtra("MyData", "Regions");
                        //    //StartActivity(intent);
                        //};
                    }
                    catch (Exception exe)
                    {
                        LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                    }
                    //Top.Dispose();
                    //Bottom.Dispose();
                    //Middle.Dispose();
                }

                TokenModel devInfo         = new TokenModel();
                var        activityManager = (ActivityManager)this.Context.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;
                sr.Stop();
                LoggingClass.LogTime("tab activity time", sr.Elapsed.TotalSeconds.ToString());
                return(view);
            }
コード例 #17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            //AndHUD.Shared.Dismiss();
            CheckInternetConnection();
            Stopwatch st = new Stopwatch();

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

            SetContentView(Resource.Layout.detailedView);
            //         WineBarcode = Intent.GetStringExtra("WineBarcode");
            //storeid = Intent.GetIntExtra("storeid", 1);
            //ActionBar.SetHomeButtonEnabled(true);
            //ActionBar.SetDisplayHomeAsUpEnabled(true);
            //ServiceWrapper svc = new ServiceWrapper();
            //         myData = new ItemDetailsResponse();
            //ItemReviewResponse SkuRating = new ItemReviewResponse();
            //this.Title = "Wine Details";
            commentsview           = FindViewById <ListView>(Resource.Id.listView2);
            WineName               = FindViewById <TextView>(Resource.Id.txtWineName); //Assigning values to respected Textfields
            WineName.Focusable     = false;
            WineProducer           = FindViewById <TextView>(Resource.Id.txtProducer);
            WineProducer.Focusable = false;
            Vintage                     = FindViewById <TextView>(Resource.Id.txtVintage);
            Vintage.Focusable           = false;
            WineDescription             = FindViewById <TextView>(Resource.Id.txtWineDescription);
            WineDescription.Focusable   = false;
            AvgRating                   = FindViewById <RatingBar>(Resource.Id.avgrating);
            AvgRating.Focusable         = false;
            ErrorDescription            = FindViewById <TextView>(Resource.Id.Error);
            ErrorDescription.Focusable  = false;
            ErrorDescription.Visibility = ViewStates.Gone;
            TableRow tr5 = FindViewById <TableRow>(Resource.Id.tableRow5);

            WineBarcode = Intent.GetStringExtra("WineBarcode");
            storeid     = 1;// Intent.GetIntExtra("storeid", 1);
            Review edit = new Review()
            {
                Barcode    = WineBarcode,
                RatingText = "",
                PlantFinal = storeid.ToString()
            };

            ItemReviewResponse SkuRating = new ItemReviewResponse();
            ServiceWrapper     svc       = new ServiceWrapper();

            SkuRating = svc.GetItemReviewsByWineBarcode(WineBarcode).Result;
            var tempReview = SkuRating.Reviews.ToList().Find(x => x.ReviewUserId == Convert.ToInt32(CurrentUser.getUserId()));

            if (tempReview != null)
            {
                edit.RatingText = tempReview.RatingText;
            }
            editPopup   = new ReviewPopup(this, edit);
            RatingInput = FindViewById <RatingBar>(Resource.Id.ratingInput);//Taking rating stars input
            RatingInput.RatingBarChange += editPopup.CreatePopup;

            flag = 1;
            Internal_ViewDidLoad();
            st.Stop();
            //AndHUD.Shared.Dismiss();
            try
            {
                ProgressIndicator.Hide();
            }
            catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); }
            LoggingClass.LogTime("Detail activity", st.Elapsed.TotalSeconds.ToString());
        }
コード例 #18
0
        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());
        }
コード例 #19
0
 public async override void OnBackPressed()
 {
     ProgressIndicator.Hide();
 }
コード例 #20
0
        protected override void OnCreate(Bundle bundle)
        {
            CheckInternetConnection();
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Profile);
            try
            {
                GC.Collect();
                LoggingClass.LogInfo("Entered into Profile Activity", screenid);
                ActionBar.SetHomeButtonEnabled(true);
                ActionBar.SetDisplayHomeAsUpEnabled(true);
                int            userId       = Convert.ToInt32(CurrentUser.getUserId());
                ServiceWrapper sw           = new ServiceWrapper();
                var            output       = sw.GetCustomerDetails(userId).Result;
                EditText       Firstname    = FindViewById <EditText>(Resource.Id.txtFirstName);
                Button         updatebtn    = FindViewById <Button>(Resource.Id.UpdateButton);
                Spinner        spn          = FindViewById <Spinner>(Resource.Id.spinner);
                Spinner        Prefered     = FindViewById <Spinner>(Resource.Id.spinner1);
                EditText       Mobilenumber = FindViewById <EditText>(Resource.Id.txtMobileNumber);
                EditText       Lastname     = FindViewById <EditText>(Resource.Id.txtLastName);
                EditText       Email        = FindViewById <EditText>(Resource.Id.txtEmail);
                EditText       Address      = FindViewById <EditText>(Resource.Id.txtAddress);
                EditText       PinCode      = FindViewById <EditText>(Resource.Id.txtZip);
                if (CurrentUser.getUserId() == "0" || CurrentUser.getUserId() == null)
                {
                    AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                    aler.SetTitle("Sorry");
                    aler.SetMessage("This feature is available only  for VIP Users");
                    aler.SetPositiveButton("Log in", delegate
                    {
                        string str = null;
                        CurrentUser.SaveGuestId(str);
                        var intent = new Intent(this, typeof(LoginActivity));
                        StartActivity(intent);
                    });
                    aler.SetNegativeButton("KnowMore", delegate
                    {
                        var uri    = Android.Net.Uri.Parse("https://hangoutz.azurewebsites.net/index.html");
                        var intent = new Intent(Intent.ActionView, uri);
                        StartActivity(intent);
                    });
                    aler.SetNeutralButton("Cancel", delegate
                    {
                        var intent = new Intent(this, typeof(Login));
                        StartActivity(intent);
                    });
                    Dialog dialog1 = aler.Create();
                    dialog1.Show();
                }
                else
                {
                    Firstname.Text = output.customer.FirstName;
                    Lastname.Text  = output.customer.LastName;
                    string phno1 = output.customer.PhoneNumber;
                    string phno2 = output.customer.Phone2;
                    if (phno1 != null)
                    {
                        Mobilenumber.Text = phno1;
                    }
                    else
                    {
                        Mobilenumber.Text = phno2;
                    }
                    Email.Text = output.customer.Email;
                    string Addres2 = output.customer.Address2;
                    string Addres1 = output.customer.Address1;
                    Address.Text = string.Concat(Addres1, Addres2);
                    PinCode.Text = output.customer.Zip;
                    string        state         = output.customer.State;
                    int           Preferedstore = output.customer.PreferredStore;
                    List <string> storelist     = new List <string>();
                    storelist.Add("--Select your preferred store--");
                    storelist.Add("Wall");
                    storelist.Add("Point Pleasant");
                    storelist.Add("Secaucus");
                    storelist.Add("All");
                    List <string> StateList = new List <string>();
                    StateList.Add("AL");
                    StateList.Add("AK");
                    StateList.Add("AZ");
                    StateList.Add("AR");
                    StateList.Add("CA");
                    StateList.Add("CO");
                    StateList.Add("CT");
                    StateList.Add("DE");
                    StateList.Add("FL");
                    StateList.Add("GA");
                    StateList.Add("HI");
                    StateList.Add("ID");
                    StateList.Add("IL");
                    StateList.Add("IN");
                    StateList.Add("IA");
                    StateList.Add("KS");
                    StateList.Add("KY");
                    StateList.Add("LA");
                    StateList.Add("ME");
                    StateList.Add("MD");
                    StateList.Add("MA");
                    StateList.Add("MI");
                    StateList.Add("MN");
                    StateList.Add("MS");
                    StateList.Add("MO");
                    StateList.Add("MT");
                    StateList.Add("NE");
                    StateList.Add("NV");
                    StateList.Add("NH");
                    StateList.Add("NJ");
                    StateList.Add("NM");
                    StateList.Add("NY");
                    StateList.Add("NC");
                    StateList.Add("ND");
                    StateList.Add("OH");
                    StateList.Add("OK");
                    StateList.Add("OR");
                    StateList.Add("PA");
                    StateList.Add("RI");
                    StateList.Add("SC");
                    StateList.Add("SD");
                    StateList.Add("TN");
                    StateList.Add("TX");
                    StateList.Add("UT");
                    StateList.Add("VT");
                    StateList.Add("VA");
                    StateList.Add("WA");
                    StateList.Add("WV");
                    StateList.Add("WI");
                    StateList.Add("WY");
                    try
                    {
                        int i = StateList.IndexOf(state.ToString());
                        spn.SetSelection(i);
                    }
                    catch { }
                    int p = storelist.IndexOf(Prefered.SelectedItem.ToString());
                    Prefered.SetSelection(Preferedstore);


                    updatebtn.Click += async delegate
                    {
                        if ((Email.Text.Contains("@")) == false || (Email.Text.Contains(".")) == false)
                        {
                            AndHUD.Shared.ShowErrorWithStatus(this, "Email is invalid", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                        else if ((PinCode.Text.Length != 5))
                        {
                            AndHUD.Shared.ShowErrorWithStatus(this, "Zipcode is invalid", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                        else if ((Mobilenumber.Text == "") || (Mobilenumber.Text.Length != 10))
                        {
                            AndHUD.Shared.ShowErrorWithStatus(this, "Enter valid mobile number", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                        else
                        {
                            AndHUD.Shared.Show(this, "Please Wait...", Convert.ToInt32(MaskType.Clear));

                            Customer customer = new Customer()
                            {
                                FirstName      = Firstname.Text,
                                LastName       = Lastname.Text,
                                PhoneNumber    = Mobilenumber.Text,
                                Address1       = Address.Text,
                                Email          = Email.Text,
                                CustomerID     = userId,
                                State          = spn.SelectedItem.ToString(),
                                Zip            = PinCode.Text,
                                PreferredStore = Convert.ToInt32(Prefered.SelectedItemId)
                            };
                            CurrentUser.SavePrefered(Convert.ToInt32(Prefered.SelectedItemId));
                            LoggingClass.LogInfo("Clicked on update info", screenid);
                            var x = await sw.UpdateCustomer(customer);

                            if (x == 1)
                            {
                                var intent = new Intent(this, typeof(PotraitActivity));
                                StartActivity(intent);
                            }
                            AndHUD.Shared.Dismiss();
                            AndHUD.Shared.ShowSuccess(this, "Profile Updated", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                    };
                    ProgressIndicator.Hide();
                    updatebtn.Dispose();
                }
            }
            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();
            }

            ProgressIndicator.Hide();
        }