//Stopwatch st;
        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            //st.Start();
            base.OnActivityResult(requestCode, resultCode, data);
            LoggingClass.LogInfo("Entered into ProfilePictureGallery", screenid);
            if (resultCode == Result.Ok)
            {
                string Path = GetRealPathFromURI(data.Data);
                try
                {
                    Bitmap propic = BitmapFactory.DecodeFile(Path);
                    ProfilePicturePickDialog pppd = new ProfilePicturePickDialog();
                    string dir_path = pppd.CreateDirectoryForPictures();
                    dir_path = dir_path + "/" + Convert.ToInt32(CurrentUser.getUserId()) + ".jpg";
                    ProfileActivity pa       = new ProfileActivity();
                    Bitmap          resized  = pa.Resize(propic, 400, 400);
                    var             filePath = System.IO.Path.Combine(dir_path);
                    var             stream   = new FileStream(filePath, FileMode.Create);
                    resized.Compress(Bitmap.CompressFormat.Jpeg, 100, stream);
                    stream.Close();
                    pppd.UploadProfilePic(filePath);
                    Intent intent = new Intent(this, typeof(TabActivity));
                    StartActivity(intent);
                }

                catch (Exception exe)
                {
                    LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                }
            }
            //st.Stop();
            //LoggingClass.LogTime("profile pic gall time", st.Elapsed.TotalSeconds.ToString());
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.ItemId == Android.Resource.Id.Home)
            {
                AndHUD.Shared.Dismiss();
                base.OnBackPressed();
                AndHUD.Shared.Dismiss();
                LoggingClass.LogInfo("Exited from Detail View", screenid);
                //TokenModel devInfo = new TokenModel();
                //var activityManager = (ActivityManager)this.GetSystemService(Context.ActivityService);

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

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

                //devInfo.AvailableMainMemory = memInfo.AvailMem;
                //devInfo.IsLowMainMemory = memInfo.LowMemory;
                //devInfo.TotalMainMemory = memInfo.TotalMem;
                ProgressIndicator.Hide();
                return(false);
            }
            return(base.OnOptionsItemSelected(item));
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.ItemId == Android.Resource.Id.Home)
            {
                // base.OnBackPressed();
                var intent = new Intent(this, typeof(TabActivity));
                LoggingClass.LogInfo("Clicked on options menu About", screenid);
                StartActivity(intent);
                LoggingClass.LogInfo("Exited from Gridview Activity", screenid);
                TokenModel devInfo         = new TokenModel();
                var        activityManager = (ActivityManager)this.GetSystemService(Context.ActivityService);

                //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;
                return(false);
            }
            return(base.OnOptionsItemSelected(item));
        }
示例#4
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View row = convertView;

            if (row == null)
            {
                row = LayoutInflater.From(myContext).Inflate(Resource.Layout.WinePropertiesCell, null, false);
            }
            LoggingClass.LogInfo("Entered into DetailsViewAdapter", screenid);
            TextView Type  = row.FindViewById <TextView>(Resource.Id.textView12);
            TextView Value = row.FindViewById <TextView>(Resource.Id.textView13);

            Type.LayoutParameters.Width = 550;
            Type.Text  = myItems[position].Name;
            Value.Text = myItems[position].Vintage.ToString();
            if (Value.Text == null || Value.Text == "0")
            {
                Value.Text = "";
            }
            else
            {
                Value.Text = myItems[position].Vintage.ToString();
            }
            Type.Focusable  = false;
            Value.Focusable = false;


            return(row);
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.ItemId == Android.Resource.Id.Home)
            {
                string Back = Intent.GetStringExtra("Back");
                if (Back == "Back")
                {
                    var intent = new Intent(this, typeof(Login));
                    StartActivity(intent);
                }
                else
                {
                    AndHUD.Shared.Dismiss();
                    base.OnBackPressed();
                    GC.Collect();
                }
                AndHUD.Shared.Dismiss();
                try
                {
                    ProgressIndicator.Hide();
                }
                catch (Exception ex) { }
                LoggingClass.LogInfo("Exited from Detail View", screenid);

                return(false);
            }
            return(base.OnOptionsItemSelected(item));
        }
示例#6
0
        public async void ShowInfo(CustomerResponse AuthServ)
        {
            int count = 0;
            int cou   = 0;

            AndHUD.Shared.Show(this, "Please Wait...", Convert.ToInt32(MaskType.Clear));
            try
            {
                if (AuthServ.customer.Email != "" && AuthServ.customer.Email != null)
                {
                    TxtScanresult.Text = AuthServ.ErrorDescription;    // " Hi " + AuthServ.customer.FirstName + authen.customer.LastName + ",\n We have sent an email at  " + authen.customer.Email + ".\n Please verify email to continue login. \n If you have not received email Click Resend Email.\n To get Email Id changed, contact store.";

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

                                AndHUD.Shared.ShowSuccess(this, "Sent", MaskType.Clear, TimeSpan.FromSeconds(2));
                                AndHUD.Shared.Dismiss();
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                    };
                    count           = 0;
                    BtnLogin.Click += delegate
                    {
                        LoggingClass.LogInfo("Clicked on Login " + AuthServ.customer.CardNumber, screenid);

                        AndHUD.Shared.Show(this, "Checking Email Verification", Convert.ToInt32(MaskType.Clear));
                        EmailVerification();
                    };
                }
                else
                {
                    TxtScanresult.Text = AuthServ.ErrorDescription;
                    TxtScanresult.SetTextColor(Android.Graphics.Color.Red);
                }
                AndHUD.Shared.Dismiss();
            }

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

            AndHUD.Shared.Dismiss();
        }
示例#7
0
        private void BindGridData()
        {
            try
            {
                ServiceWrapper svc = new ServiceWrapper();

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

            switch (item.ItemId)
            {
            case Resource.Id.action_settings3:
                ProgressIndicator.Show(this);
                intent = new Intent(this, typeof(AboutActivity));
                break;
            }
            if (intent != null)
            {
                StartActivity(intent);
            }
            if (item.ItemId == Android.Resource.Id.Home)
            {
                base.OnBackPressed();

                intent = new Intent(this, typeof(Login));
                StartActivity(intent);
                LoggingClass.LogInfo("Exited from Gridview Activity", screenid);
                ProgressIndicator.Hide();
                return(true);
            }
            return(base.OnOptionsItemSelected(item));
        }
        public async override void OnBackPressed()
        {
            var intent = new Intent(this, typeof(TabActivity));

            LoggingClass.LogInfo("Clicked on options menu About", screenid);
            StartActivity(intent);
        }
        public bool CheckInternetConnection()
        {
            string CheckUrl = "http://google.com";

            try
            {
                HttpWebRequest iNetRequest = (HttpWebRequest)WebRequest.Create(CheckUrl);

                iNetRequest.Timeout = 5000;

                WebResponse iNetResponse = iNetRequest.GetResponse();

                // Console.WriteLine ("...connection established..." + iNetRequest.ToString ());
                iNetResponse.Close();

                return(true);
            }
            catch (WebException ex)
            {
                AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                aler.SetTitle("Sorry");
                LoggingClass.LogInfo("Please check your internet connection", screenid);
                aler.SetMessage("Please check your internet connection");
                aler.SetNegativeButton("Ok", delegate { });
                Dialog dialog = aler.Create();
                dialog.Show();
                return(false);
            }
        }
示例#11
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.TitleColor = Color.LightGray;
            SetContentView(Resource.Layout.Fragment);

            try
            {
                // LoggingClass.UploadErrorLogs();
                //LoggingClass.Upload(LoggingClass.CreateDirectoryForLogs());
                //File.Delete(LoggingClass.CreateDirectoryForLogs());
            }
            catch (Exception exe)
            {
                Log.Error("Hangouts", exe.Message);
            }
            this.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;
            LoggingClass.LogInfo("Entered into Tab Activity", screenid);
            AddTab("Locations", 1, new SampleTabFragment("Locations", this));
            AddTab("My Hangouts", 1, new SampleTabFragment("My Hangouts", this));
            //AddTab("Explore",1, new SampleTabFragment("Explore", this));

            if (bundle != null)
            {
                this.ActionBar.SelectTab(this.ActionBar.GetTabAt(bundle.GetInt("tab")));
            }
        }
示例#12
0
        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            if (resultCode.ToString() == "Canceled")
            {
                LoggingClass.LogInfo("Cancelled from camera", screenid);
                Intent intent = new Intent(this, typeof(TabActivity));
                StartActivity(intent);
            }
            else
            {
                // Make it available in the gallery
                try
                {
                    Intent mediaScanIntent = new Intent(Intent.ActionMediaScannerScanFile);
                    Uri    contentUri      = Uri.FromFile(App._file);
                    mediaScanIntent.SetData(contentUri);
                    SendBroadcast(mediaScanIntent);
                }
                catch (Exception exe)
                {
                    LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                    Intent intent1 = new Intent(this, typeof(ProfileActivity));
                    StartActivity(intent1);
                }
                Resize();
                UploadProfilePic(path);
                Intent intent = new Intent(this, typeof(TabActivity));
                StartActivity(intent);
                GC.Collect();

                //LoggingClass.LogTime("profile  piccture ",st.Elapsed.TotalSeconds.ToString());
            }
        }
示例#13
0
        private void BindGridData()
        {
            int StoreId = 0;

            if (StoreName == "Wall Store")
            {
                StoreId = 1;
            }
            else if (StoreName == "Point Pleasant Store")
            {
                StoreId = 2;
            }
            else
            {
                StoreId = 3;
            }
            try
            {
                int              userId = Convert.ToInt32(CurrentUser.getUserId());
                ServiceWrapper   sw     = new ServiceWrapper();
                ItemListResponse output = sw.GetItemList(StoreId, userId).Result;

                List <Item> myArr = output.ItemList.ToList();
                LoggingClass.LogInfo("entered into " + StoreName, screenid);
                var gridview = FindViewById <GridView>(Resource.Id.gridview);
                adapter = new GridViewAdapter(this, myArr, StoreId);
                LoggingClass.LogInfoEx("Entered into Grid View Adapter", screenid);
                gridview.SetNumColumns(2);
                gridview.Adapter = adapter;

                gridview.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
                {
                    WineBarcode = myArr[args.Position].Barcode;
                    // 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);
                };
                //TokenModel devInfo = new TokenModel();
                //var activityManager = (ActivityManager)this.GetSystemService(Context.ActivityService);

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

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

                //devInfo.AvailableMainMemory = memInfo.AvailMem;
                //devInfo.IsLowMainMemory = memInfo.LowMemory;
                //devInfo.TotalMainMemory = memInfo.TotalMem;
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
            }
        }
示例#14
0
        protected override void OnCreate(Bundle bundle)
        {
            Stopwatch st = new Stopwatch();

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

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

                ServiceWrapper svc = new ServiceWrapper();

                var MYtastings = svc.GetMyTastingsList(customerid).Result;
                myArr1 = MYtastings.TastingList.ToList();
                if (MYtastings.TastingList.Count == 0)
                {
                    SetContentView(Resource.Layout.EmptyTaste);
                    TextView te = FindViewById <TextView>(Resource.Id.textView123a);
                }
                else
                {
                    SetContentView(Resource.Layout.MyTasting);

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

                    //mSwipeRefreshLayout.Refresh += MSwipeRefreshLayout_Refresh;
                    //mSwipeRefreshLayout.SetColorScheme(Resource.Color.abc_background_cache_hint_selector_material_dark, Resource.Color.abc_background_cache_hint_selector_material_light);

                    mSwipeRefreshLayout.Refresh += async delegate {
                        //BindGridData();
                        LoggingClass.LogInfo("Refreshed My Tasting", screenid);
                        await SomeAsync();

                        mSwipeRefreshLayout.Refreshing = false;
                    };

                    ActionBar.SetHomeButtonEnabled(true);
                    ActionBar.SetDisplayHomeAsUpEnabled(true);
                }
                ProgressIndicator.Hide();
            }

            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                AlertDialog.Builder aler = new AlertDialog.Builder(this);
                aler.SetTitle("Sorry");
                aler.SetMessage("We're under maintainence");
                aler.SetNegativeButton("Ok", delegate { });
                Dialog dialog = aler.Create();
                dialog.Show();
            }
            st.Stop();
            LoggingClass.LogTime("Tastingactivity", st.Elapsed.TotalSeconds.ToString());
        }
示例#15
0
        private void MSwipeRefreshLayout_Refresh(object sender, EventArgs e)
        {
            BindGridData();
            SwipeRefreshLayout mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.PullDownRefresh1);

            LoggingClass.LogInfo("Refreshed My Tasting", screenid);
            mSwipeRefreshLayout.Refreshing = false;
        }
示例#16
0
        public void EditPopup(object sender, EventArgs e)
        {
            try
            {
                Dialog editDialog = new Dialog(Parent);
                int    screenid   = 18;
                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);
                Comments.Text     = _editObj.RatingText;
                custRating.Rating = _editObj.RatingStars;
                LoggingClass.LogInfo("Entered into EditPopup", screenid);
                close.SetScaleType(ImageView.ScaleType.CenterCrop);
                editDialog.Window.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.Transparent));
                editDialog.Show();
                editDialog.SetCanceledOnTouchOutside(false);

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

                        LoggingClass.LogInfo("Edited Review-----> " + review.RatingText + "-----> " + review.RatingStars + "----->" + review.Barcode + "----->" + review.PlantFinal + "submitted", screenid);
                    }

                    catch (Exception exe)
                    {
                        LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                    }
                    ((IPopupParent)Parent).RefreshParent();
                    AndHUD.Shared.Dismiss();
                    AndHUD.Shared.ShowSuccess(Parent, "Sucessfully Saved", MaskType.Clear, TimeSpan.FromSeconds(2));
                    editDialog.Dismiss();
                };
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, ParentScreenId, exe.StackTrace.ToString());
            }
        }
示例#17
0
        private void BindGridData()
        {
            int StoreId = 0;

            if (StoreName == AppConstants.WallStore)
            {
                StoreId = 1;
            }
            else if (StoreName == AppConstants.PointPleasantStore)
            {
                StoreId = 2;
            }
            else if (StoreName == AppConstants.SecaucusStore)
            {
                StoreId = 3;
            }
            try
            {
                int              userId = Convert.ToInt32(CurrentUser.getUserId());
                ServiceWrapper   sw     = new ServiceWrapper();
                ItemListResponse output = sw.GetItemList(StoreId, userId).Result;

                List <Item> myArr = output.ItemList.ToList();
                if (myArr.Count == 0)
                {
                    AlertDialog.Builder aler = new AlertDialog.Builder(this);
                    aler.SetTitle("Secaucus Store");
                    aler.SetMessage("Coming Soon!");
                    aler.SetNegativeButton("Ok", delegate {
                        var intent = new Intent(this, typeof(Login));
                        StartActivity(intent);
                    });
                    LoggingClass.LogInfo("Clicked on Secaucus", screenid);
                    Dialog dialog = aler.Create();
                    dialog.Show();
                }
                LoggingClass.LogInfo("entered into " + StoreName, screenid);
                var gridview = FindViewById <GridView>(Resource.Id.gridview);
                adapter = new GridViewAdapter(this, myArr, StoreId);
                LoggingClass.LogInfoEx("Entered into Grid View Adapter", screenid);
                gridview.SetNumColumns(2);
                gridview.Adapter    = adapter;
                gridview.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
                {
                    WineBarcode = myArr[args.Position].Barcode;
                    ProgressIndicator.Show(this);
                    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);
                    StartActivity(intent);
                };
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
            }
        }
示例#18
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            Intent intent = null;

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

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

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

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

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

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

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

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

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

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

                Dialog dialog = aler.Create();
                dialog.Show();
            }
            catch (Exception ex) { }
        }
示例#20
0
        // SwipeRefreshLayout refresher1;



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

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

            SetContentView(Resource.Layout.Main);

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

                BindGridData();

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

                //mSwipeRefreshLayout.Refresh += MSwipeRefreshLayout_Refresh;
                //mSwipeRefreshLayout.SetColorScheme(Resource.Color.abc_background_cache_hint_selector_material_dark, Resource.Color.abc_background_cache_hint_selector_material_light);

                mSwipeRefreshLayout.Refresh += async delegate {
                    //BindGridData();
                    LoggingClass.LogInfo("Refreshed grid view", screenid);
                    await SomeAsync();

                    mSwipeRefreshLayout.Refreshing = false;
                };

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

                ProgressIndicator.Hide();
                LoggingClass.LogInfo("Entered into gridview activity", screenid);
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                ProgressIndicator.Hide();
                AlertDialog.Builder aler = new AlertDialog.Builder(this);
                aler.SetTitle("Sorry");
                aler.SetMessage("We're under maintainence");
                aler.SetNegativeButton("Ok", delegate { });
                Dialog dialog = aler.Create();
                dialog.Show();
            }

            st.Stop();
            LoggingClass.LogTime("Gridactivity", st.Elapsed.TotalSeconds.ToString());
        }
示例#21
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     if (item.ItemId == Android.Resource.Id.Home)
     {
         Finish();
         LoggingClass.LogInfo("Exited from My Tasting", screenid);
         return(false);
     }
     return(base.OnOptionsItemSelected(item));
 }
示例#22
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     if (item.ItemId == Android.Resource.Id.Home)
     {
         base.OnBackPressed();
         LoggingClass.LogInfo("Exited from My Favorites", screenid);
         return(false);
     }
     return(base.OnOptionsItemSelected(item));
 }
示例#23
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.EditReviewPopup, container, false);

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


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

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

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

            dialog.Show();
        }
示例#27
0
        public void IncorrectDetailsAlert()
        {
            AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
            LoggingClass.LogInfo("Entered Incorrect Details", screenid);
            aler.SetTitle("Sorry");
            aler.SetMessage("Incorrect Details");
            aler.SetNegativeButton("Ok", delegate { });
            Dialog dialog = aler.Create();

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

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

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

            LoggingClass.LogInfo("Updated profile picture", screenid);
            await blob.UploadFromByteArrayAsync(bitmapData, 0, bitmapData.Length);
        }