public void Dispose()
 {
     if (button != null)
     {
         button.Dispose();
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (ImageButton != null)
            {
                ImageButton.Dispose();
                ImageButton = null;
            }

            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            CheckInternetConnection();
            Stopwatch st = new Stopwatch();

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

            TaskA.Start();
            //checking user id's exist or not.
            if ((CurrentUser.getUserId() != null || CurrentUser.getUserId() != "0") && (CurrentUser.getUserId() != null))
            {
                IntoApp();
            }
            else if (CurrentUser.GetGuestId() != null || CurrentUser.getUserId() == "0")
            {
                IntoApp();
            }
            else
            {
                //if (CurrentUser.GetCardNumber() != null)
                //{
                //    Preinfo(CurrentUser.GetCardNumber());
                //}
                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";// "900497354894";//await scanner.Scan();

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

                BtnGuestLogin.Click += async delegate
                {
                    Intent intent = new Intent(this, typeof(Login));
                    ProgressIndicator.Show(this);
                    LoggingClass.LogInfo("User Tried to login with Guest Login ", screenid);
                    StartActivity(intent);
                    CustomerResponse csr = new CustomerResponse();
                    csr = await svc.InsertUpdateGuest("Didn't get the token");

                    CurrentUser.SaveGuestId(csr.customer.CustomerID.ToString());
                };
                TxtScanresult             = FindViewById <TextView>(Resource.Id.txtScanresult);
                Txtem                     = FindViewById <TextView>(Resource.Id.textV);
                BtnLogin                  = FindViewById <Button>(Resource.Id.btnLogin);
                txtmail                   = FindViewById <EditText>(Resource.Id.txtmail);
                BtnResend                 = FindViewById <Button>(Resource.Id.btnResend);
                update                    = FindViewById <Button>(Resource.Id.btnUpdateEmailclick);
                BtnContinue               = FindViewById <Button>(Resource.Id.btnContinue);
                BtnUpdateEmail            = FindViewById <Button>(Resource.Id.btnUpdateEmail);
                BtnResend.Visibility      = ViewStates.Gone;
                update.Visibility         = ViewStates.Gone;
                BtnLogin.Visibility       = ViewStates.Gone;
                BtnContinue.Visibility    = ViewStates.Gone;
                BtnUpdateEmail.Visibility = ViewStates.Gone;
                txtmail.Visibility        = ViewStates.Gone;
                Txtem.Visibility          = ViewStates.Gone;
                if (IsPlayServicesAvailable())
                {
                    var TaskB = new System.Threading.Tasks.Task(() =>
                    {
                        var intent = new Intent(this, typeof(RegistrationIntentService));
                        StartService(intent);
                    });
                    TaskB.Start();
                }
                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);
                BtnScanner.Dispose();
            }
        }
    public void Build()
    {
        string username = UserHelper.GetUserId(Request.LogonUserIdentity.Name);
        string group    = string.Empty;
        string name     = string.Empty;
        bool   pendings = false;

        SqlDataReader myReader = SQLHelper.ExecuteReader(Cache["ApplicationDatabase"].ToString(), "GetEvaluatedPeople", new object[] { username });

        #region SelfEvaluation
        DataTable dt     = new DataTable();
        clsDAO    objDAO = new clsDAO();
        dt = objDAO.SqlCall("GetSelfEvaluationAllowance '" + username + "'");
        if (dt.Rows.Count > 0)
        {
            TblSelfEvaluation.Visible = true;

            TableRow  tblRowGroup   = new TableRow();
            TableCell tblCellGroup  = new TableCell();
            TableCell tblCellButton = new TableCell();
            Button    button        = new Button();

            button.Text = "Autoevaluación";
            button.Attributes.Add("class", "btn");
            button.PostBackUrl      = Server.HtmlEncode("~/EvaluationFormSelf.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(dt.Rows[0][2].ToString() + ".0.0." + dt.Rows[0][0].ToString())));
            tblCellGroup.Text       = dt.Rows[0][1].ToString();
            tblCellGroup.ColumnSpan = 4;
            tblCellGroup.Attributes.Add("class", "td06");
            tblRowGroup.Cells.Add(tblCellGroup);
            tblRowGroup.Cells.Add(tblCellButton);
            tblCellButton.Controls.Add(button);
            tblCellButton.Attributes.Add("class", "td06");
            tblCellButton.ColumnSpan = 2;
            TblSelfEvaluation.Rows.Add(tblRowGroup);
            tblCellGroup.Dispose();
            tblCellButton.Dispose();
            tblRowGroup.Dispose();
            button.Dispose();
        }
        #endregion

        #region Evaluator
        int c = 0;
        Tbl1.Visible = (myReader.HasRows);

        while (myReader.Read())
        {
            pendings = true;
            if (group != myReader.GetValue(0).ToString())
            {
                TableRow  tblRowGroup   = new TableRow();
                TableCell tblCellGroup  = new TableCell();
                TableCell tblCellButton = new TableCell();
                Button    button        = new Button();

                bool _status = ("1,2,5,8,11".IndexOf(myReader[8].ToString(), 0) >= 0);

                DataSet myReaderEnabled = SQLHelper.ExecuteDataset(Cache["ApplicationDatabase"].ToString(), "GetAssessmentAccesibility", new object[] { username });

                if (myReaderEnabled.Tables[0].Rows[0].ItemArray[0].ToString() == "1" || myReaderEnabled.Tables[0].Rows[0].ItemArray[0].ToString() == "5")
                {
                    button.Visible = true;
                }
                else
                {
                    button.Visible = false;
                }

                button.Text    = (_status) ? "Evaluar" : "Visualizar";
                button.ToolTip = ((_status) ? "Evalua" : "Visualiza") + " las personas del " + myReader.GetValue(0).ToString();
                button.Attributes.Add("class", "btn");
                button.PostBackUrl      = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader.GetValue(6).ToString() + ".1." + myReader[8].ToString())));
                tblCellGroup.Text       = myReader.GetValue(0).ToString();
                tblCellGroup.ColumnSpan = 4;
                tblCellGroup.Attributes.Add("class", "td06");
                tblRowGroup.Cells.Add(tblCellGroup);
                tblRowGroup.Cells.Add(tblCellButton);
                tblCellButton.Controls.Add(button);
                tblCellButton.Attributes.Add("class", "td06");
                tblCellButton.ColumnSpan = 2;
                Tbl1.Rows.Add(tblRowGroup);
                tblCellGroup.Dispose();
                tblCellButton.Dispose();
                tblRowGroup.Dispose();
                button.Dispose();
            }

            TableRow tblRow = new TableRow();


            TableCell   tblCellImg = new TableCell();
            ImageButton img        = new ImageButton();

            //if (((decimal)myReader[7] != 10))
            //{
            img.ID       = c.ToString();
            img.ImageUrl = "~/App_Images/search.jpg";
            img.ToolTip  = "Ver solo esta evaluación";
            c++;
            img.PostBackUrl  = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader[6].ToString() + ".1." + myReader[7].ToString() + "." + myReader[9].ToString())));
            tblCellImg.Width = 16;
            tblCellImg.Attributes.Add("class", "td02");
            tblCellImg.Controls.Add(img);
            img.Dispose();

            if ((decimal)myReader[7] == 10 || (decimal)myReader[7] == 12)
            {
                img    = new ImageButton();
                img.ID = c.ToString();
                c++;
                img.ImageUrl      = "~/App_Images/imp.gif";
                img.OnClientClick = "p(" + myReader[9].ToString() + ")";
                img.ToolTip       = "Imprimir Evaluación";
                tblCellImg.Controls.Add(img);
                img.Dispose();
                tblCellImg.Width = 38;
            }

            tblRow.Cells.Add(tblCellImg);
            tblCellImg.Dispose();
            //}
            //else
            //{

            //    img.ID = c.ToString();
            //    img.ImageUrl = "~/App_Images/imp.gif";
            //    img.OnClientClick = "p(" + myReader[9].ToString() + ")";
            //    img.ToolTip = "Imprimir Evaluación";
            //    c++;
            //    tblCellImg.Width = 16;
            //    tblCellImg.Attributes.Add("class", "td02");
            //    tblCellImg.Controls.Add(img);
            //    img.Dispose();
            //    tblRow.Cells.Add(tblCellImg);
            //    tblCellImg.Dispose();
            //}

            for (int i = 1; i < 6; i++)
            {
                TableCell tblCell = new TableCell();
                switch (i)
                {
                case 3:
                    tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 5) ? "" : myReader.GetValue(i).ToString().Trim().ToLower());
                    tblCell.Attributes.Add("class", "td02c");
                    break;

                case 4:
                    tblCell.Text = myReader.GetValue(i).ToString();
                    tblCell.Attributes.Add("class", "td02");
                    break;

                case 5:
                    tblCell.Attributes.Add("class", (i == 5) ? myReader.GetValue(i).ToString() : "td02");
                    break;

                default:
                    tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 5) ? "" : myReader.GetValue(i).ToString().Trim().ToLower());
                    tblCell.Attributes.Add("class", "td02");
                    break;
                }

                if (i == 1 && ((decimal)myReader[7] != 10))
                {
                    // tblCell.ColumnSpan = 2;
                }
                tblRow.Cells.Add(tblCell);
                tblCell.Dispose();
            }
            Tbl1.Rows.Add(tblRow);
            tblRow.Dispose();

            group = myReader.GetValue(0).ToString();
        }
        if (Tbl1.Visible)
        {
            AddSeparator(Tbl1);
        }
        ;
        #endregion

        #region Concurrent
        myReader.NextResult();
        Tbl2.Visible = (myReader.HasRows);
        name         = string.Empty;
        group        = string.Empty;
        while (myReader.Read())
        {
            pendings = true;
            if (name != myReader.GetValue(0).ToString())
            {
                TableRow  tblRowName  = new TableRow();
                TableCell tblCellName = new TableCell();
                tblCellName.Text       = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase("Evaluador: " + myReader.GetValue(0).ToString().Trim().ToLower());
                tblCellName.ColumnSpan = 6;
                tblCellName.Attributes.Add("class", "td06L");
                tblRowName.Cells.Add(tblCellName);
                Tbl2.Rows.Add(tblRowName);
                tblCellName.Dispose();
                tblRowName.Dispose();
                group = string.Empty;
            }

            if (group != myReader.GetValue(1).ToString())
            {
                TableRow  tblRowGroup   = new TableRow();
                TableCell tblCellGroup  = new TableCell();
                TableCell tblCellButton = new TableCell();
                Button    button        = new Button();
                button.Text    = "Aprobar/Rechazar";
                button.ToolTip = "Aprueba/Rechaza personas del " + myReader.GetValue(1).ToString();
                button.Attributes.Add("class", "btn");
                button.PostBackUrl      = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader.GetValue(7).ToString() + ".2." + myReader[9].ToString())));
                tblCellGroup.Text       = myReader.GetValue(1).ToString();
                tblCellGroup.ColumnSpan = 4;
                tblCellGroup.Attributes.Add("class", "td06");
                tblRowGroup.Cells.Add(tblCellGroup);
                tblRowGroup.Cells.Add(tblCellButton);
                tblCellButton.Controls.Add(button);
                tblCellButton.Attributes.Add("class", "td06");
                tblCellButton.ColumnSpan = 2;
                Tbl2.Rows.Add(tblRowGroup);
                tblCellGroup.Dispose();
                tblCellButton.Dispose();
                tblRowGroup.Dispose();
                button.Dispose();
            }

            TableRow tblRow = new TableRow();
            for (int i = 2; i < 7; i++)
            {
                TableCell tblCell = new TableCell();

                switch (i)
                {
                case 4:
                    tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower());
                    tblCell.Attributes.Add("class", "td02c");
                    break;

                case 5:
                    tblCell.Text = myReader.GetValue(i).ToString();
                    tblCell.Attributes.Add("class", "td02");
                    break;

                case 6:
                    tblCell.Attributes.Add("class", (i == 6) ? myReader.GetValue(i).ToString() : "td02");
                    break;

                default:
                    tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower());
                    tblCell.Attributes.Add("class", "td02");
                    break;
                }
                if (i == 2)
                {
                    tblCell.ColumnSpan = 2;
                }
                tblRow.Cells.Add(tblCell);
                tblCell.Dispose();
            }
            Tbl2.Rows.Add(tblRow);
            tblRow.Dispose();

            name  = myReader.GetValue(0).ToString();
            group = myReader.GetValue(1).ToString();
        }
        if (Tbl2.Visible)
        {
            AddSeparator(Tbl2);
        }
        ;
        #endregion

        #region Double Report
        myReader.NextResult();
        Tbl3.Visible = (myReader.HasRows);
        name         = string.Empty;
        group        = string.Empty;
        while (myReader.Read())
        {
            pendings = true;
            if (name != myReader.GetValue(0).ToString())
            {
                TableRow  tblRowName  = new TableRow();
                TableCell tblCellName = new TableCell();
                tblCellName.Text       = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase("Evaluador: " + myReader.GetValue(0).ToString().Trim().ToLower());
                tblCellName.ColumnSpan = 6;
                tblCellName.Attributes.Add("class", "td06L");
                tblRowName.Cells.Add(tblCellName);
                Tbl3.Rows.Add(tblRowName);
                tblCellName.Dispose();
                tblRowName.Dispose();
                group = string.Empty;
            }

            if (group != myReader.GetValue(1).ToString())
            {
                TableRow  tblRowGroup   = new TableRow();
                TableCell tblCellGroup  = new TableCell();
                TableCell tblCellButton = new TableCell();
                Button    button        = new Button();
                button.Text    = "Aprobar/Rechazar";
                button.ToolTip = "Aprueba/Rechaza personas del " + myReader.GetValue(1).ToString();
                button.Attributes.Add("class", "btn");
                button.PostBackUrl      = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader.GetValue(7).ToString() + ".3." + myReader[9].ToString())));
                tblCellGroup.Text       = myReader.GetValue(1).ToString();
                tblCellGroup.ColumnSpan = 4;
                tblCellGroup.Attributes.Add("class", "td06");
                tblRowGroup.Cells.Add(tblCellGroup);
                tblRowGroup.Cells.Add(tblCellButton);
                tblCellButton.Controls.Add(button);
                tblCellButton.Attributes.Add("class", "td06");
                tblCellButton.ColumnSpan = 2;
                Tbl3.Rows.Add(tblRowGroup);
                tblCellGroup.Dispose();
                tblCellButton.Dispose();
                tblRowGroup.Dispose();
                button.Dispose();
            }

            TableRow tblRow = new TableRow();
            for (int i = 2; i < 7; i++)
            {
                TableCell tblCell = new TableCell();
                switch (i)
                {
                case 4:
                    tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower());
                    tblCell.Attributes.Add("class", "td02c");
                    break;

                case 5:
                    tblCell.Text = myReader.GetValue(i).ToString();
                    tblCell.Attributes.Add("class", "td02");
                    break;

                case 6:
                    tblCell.Attributes.Add("class", (i == 6) ? myReader.GetValue(i).ToString() : "td02");
                    break;

                default:
                    tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower());
                    tblCell.Attributes.Add("class", "td02");
                    break;
                }
                if (i == 2)
                {
                    tblCell.ColumnSpan = 2;
                }
                tblRow.Cells.Add(tblCell);
                tblCell.Dispose();
            }
            Tbl3.Rows.Add(tblRow);
            tblRow.Dispose();

            name  = myReader.GetValue(0).ToString();
            group = myReader.GetValue(1).ToString();
        }
        if (Tbl3.Visible)
        {
            AddSeparator(Tbl3);
        }
        ;
        #endregion

        #region HHRR
        myReader.NextResult();
        Tbl4.Visible = (myReader.HasRows);
        name         = string.Empty;
        group        = string.Empty;
        while (myReader.Read())
        {
            pendings = true;
            if (name != myReader.GetValue(0).ToString())
            {
                TableRow  tblRowName  = new TableRow();
                TableCell tblCellName = new TableCell();
                tblCellName.Text       = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase("Evaluador: " + myReader.GetValue(0).ToString().Trim().ToLower());
                tblCellName.ColumnSpan = 6;
                tblCellName.Attributes.Add("class", "td06L");
                tblRowName.Cells.Add(tblCellName);
                Tbl4.Rows.Add(tblRowName);
                tblCellName.Dispose();
                tblRowName.Dispose();
                group = string.Empty;
            }

            if (group != myReader.GetValue(1).ToString())
            {
                TableRow  tblRowGroup   = new TableRow();
                TableCell tblCellGroup  = new TableCell();
                TableCell tblCellButton = new TableCell();
                Button    button        = new Button();
                button.Text    = "Aprobar/Rechazar";
                button.ToolTip = "Aprueba/Rechaza personas del " + myReader.GetValue(1).ToString();
                button.Attributes.Add("class", "btn");
                button.PostBackUrl      = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader.GetValue(7).ToString() + ".5." + myReader[9].ToString())));
                tblCellGroup.Text       = myReader.GetValue(1).ToString();
                tblCellGroup.ColumnSpan = 4;
                tblCellGroup.Attributes.Add("class", "td06");
                tblRowGroup.Cells.Add(tblCellGroup);
                tblRowGroup.Cells.Add(tblCellButton);
                tblCellButton.Controls.Add(button);
                tblCellButton.Attributes.Add("class", "td06");
                tblCellButton.ColumnSpan = 2;
                Tbl4.Rows.Add(tblRowGroup);
                tblCellGroup.Dispose();
                tblCellButton.Dispose();
                tblRowGroup.Dispose();
                button.Dispose();
            }

            TableRow tblRow = new TableRow();
            for (int i = 2; i < 7; i++)
            {
                TableCell tblCell = new TableCell();
                switch (i)
                {
                case 4:
                    tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower());
                    tblCell.Attributes.Add("class", "td02c");
                    break;

                case 5:
                    tblCell.Text = myReader.GetValue(i).ToString();
                    tblCell.Attributes.Add("class", "td02");
                    break;

                case 6:
                    tblCell.Attributes.Add("class", (i == 6) ? myReader.GetValue(i).ToString() : "td02");
                    break;

                default:
                    tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower());
                    tblCell.Attributes.Add("class", "td02");
                    break;
                }
                if (i == 2)
                {
                    tblCell.ColumnSpan = 2;
                }
                tblRow.Cells.Add(tblCell);
                tblCell.Dispose();
            }
            Tbl4.Rows.Add(tblRow);
            tblRow.Dispose();

            name  = myReader.GetValue(0).ToString();
            group = myReader.GetValue(1).ToString();
        }
        if (Tbl4.Visible)
        {
            AddSeparator(Tbl4);
        }
        ;
        #endregion

        myReader.Close();

        QD.Visible = pendings;

        if (!pendings)
        {
            NB.Text    = "Usted no posee evaluaciones pendientes.";
            NB.Visible = true;
        }
    }
        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();
        }
        protected override void OnDestroy()
        {
            base.OnDestroy();


            //Анимация и вибрация нажатия на кнопки
            if (_fadeAnimation != null)
            {
                _fadeAnimation.Dispose();
            }
            if (_vibe != null)
            {
                _vibe.Dispose();
            }

            //Диалоговые окна оповещения
            if (_messageDialogBuilder != null)
            {
                _messageDialogBuilder.Dispose();
            }
            if (_messageDialog != null)
            {
                _messageDialog.Dispose();
            }
            if (_baseLayoutInflater != null)
            {
                _baseLayoutInflater.Dispose();
            }

            //Объекты создания прогрессДиалога
            if (_progressDialog != null)
            {
                _progressDialog.Dispose();
            }
            if (_progressDialogRelativeLayout != null)
            {
                _progressDialogRelativeLayout.Dispose();
            }
            if (_progressDialogView != null)
            {
                _progressDialogView.Dispose();
            }
            if (_progressDialogMessage != null)
            {
                _progressDialogMessage.Dispose();
            }

            //Сторонний шрифт
            if (_robotoLightFont != null)
            {
                _robotoLightFont.Dispose();
            }

            //Второстепенный поток
            if (_asyncInitThread.ThreadState == ThreadState.Running)
            {
                _asyncInitThread.Abort();
            }

            //Объекты листа Бейджа
            if (_badgeSheetBadgeImageView != null)
            {
                _badgeSheetBadgeImageView.Dispose();
            }
            if (_badgeSheetCloseImageButton != null)
            {
                _badgeSheetCloseImageButton.Dispose();
            }
            if (_badgeSheetCloseFakeImageButton != null)
            {
                _badgeSheetCloseFakeImageButton.Dispose();
            }
            if (_badgeSheetUserNameTextView != null)
            {
                _badgeSheetUserNameTextView.Dispose();
            }
            if (_badgeSheetDescrTextView != null)
            {
                _badgeSheetDescrTextView.Dispose();
            }
            if (_badgeSheetAnounceTextView != null)
            {
                _badgeSheetAnounceTextView.Dispose();
            }
            if (_badgeSheetBonusListLinearLayout != null)
            {
                _badgeSheetBonusListLinearLayout.Dispose();
            }
            if (_badgeSheetBonusView != null)
            {
                _badgeSheetBonusView.Dispose();
            }
            if (_badgeSheetBonusLineImageView != null)
            {
                _badgeSheetBonusLineImageView.Dispose();
            }
            if (_badgeSheetDiscountLineImageView != null)
            {
                _badgeSheetDiscountLineImageView.Dispose();
            }
            if (_badgeSheetPresentLineImageView != null)
            {
                _badgeSheetPresentLineImageView.Dispose();
            }
            if (_badgeSheetBonusDescrBackgroundImageView != null)
            {
                _badgeSheetBonusDescrBackgroundImageView.Dispose();
            }
            if (_badgeSheetDiscountDescrBackgroundImageView != null)
            {
                _badgeSheetDiscountDescrBackgroundImageView.Dispose();
            }
            if (_badgeSheetPresentDescrBackgroundImageView != null)
            {
                _badgeSheetPresentDescrBackgroundImageView.Dispose();
            }
            if (_badgeSheetBonusNameTextView != null)
            {
                _badgeSheetBonusNameTextView.Dispose();
            }
            if (_badgeSheetBonusDescrTextView != null)
            {
                _badgeSheetBonusDescrTextView.Dispose();
            }
        }
        protected override void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    if (existingImageWrapper != null)
                    {
                        existingImageWrapper.Dispose();
                    }
                    if (existingImage != null)
                    {
                        existingImage.Dispose();
                    }
                    if (progressBar != null)
                    {
                        progressBar.Dispose();
                    }
                    if (cropViewWrapper != null)
                    {
                        cropViewWrapper.Dispose();
                    }
                    if (cropView != null)
                    {
                        cropView.Dispose();
                    }
                    if (imageWrapper != null)
                    {
                        imageWrapper.Dispose();
                    }
                    if (missingImageButton != null)
                    {
                        missingImageButton.Dispose();
                    }
                    if (coordinatorLayout != null)
                    {
                        coordinatorLayout.Dispose();
                    }
                    if (selector != null)
                    {
                        selector.Dispose();
                    }
                    if (imageBtn != null)
                    {
                        imageBtn.Dispose();
                    }
                    if (dateBtn != null)
                    {
                        dateBtn.Dispose();
                    }
                    if (editName != null)
                    {
                        editName.Dispose();
                    }
                    if (fab != null)
                    {
                        fab.Dispose();
                    }
                    if (editAmount != null)
                    {
                        editAmount.Dispose();
                    }
                    if (toolbar != null)
                    {
                        toolbar.Dispose();
                    }
                }

                disposed = true;
            }
            base.Dispose(disposing);
        }
 void ReleaseDesignerOutlets()
 {
     if (AmountTextField != null)
     {
         AmountTextField.Dispose();
         AmountTextField = null;
     }
     if (ClientIdTextField != null)
     {
         ClientIdTextField.Dispose();
         ClientIdTextField = null;
     }
     if (CreateReportButton != null)
     {
         CreateReportButton.Dispose();
         CreateReportButton = null;
     }
     if (CurrencyTextField != null)
     {
         CurrencyTextField.Dispose();
         CurrencyTextField = null;
     }
     if (DateTextField != null)
     {
         DateTextField.Dispose();
         DateTextField = null;
     }
     if (ExpenseTypeCollapseButton != null)
     {
         ExpenseTypeCollapseButton.Dispose();
         ExpenseTypeCollapseButton = null;
     }
     if (ExpenseTypeExpandButton != null)
     {
         ExpenseTypeExpandButton.Dispose();
         ExpenseTypeExpandButton = null;
     }
     if (ExpenseTypePicker != null)
     {
         ExpenseTypePicker.Dispose();
         ExpenseTypePicker = null;
     }
     if (ImageButton != null)
     {
         ImageButton.Dispose();
         ImageButton = null;
     }
     if (LoginButton != null)
     {
         LoginButton.Dispose();
         LoginButton = null;
     }
     if (LoginIdTextField != null)
     {
         LoginIdTextField.Dispose();
         LoginIdTextField = null;
     }
     if (MyMainView != null)
     {
         MyMainView.Dispose();
         MyMainView = null;
     }
     if (PasswordTextField != null)
     {
         PasswordTextField.Dispose();
         PasswordTextField = null;
     }
     if (PaymentTypeCollapseButton != null)
     {
         PaymentTypeCollapseButton.Dispose();
         PaymentTypeCollapseButton = null;
     }
     if (PaymentTypeExpandButton != null)
     {
         PaymentTypeExpandButton.Dispose();
         PaymentTypeExpandButton = null;
     }
     if (PaymentTypePicker != null)
     {
         PaymentTypePicker.Dispose();
         PaymentTypePicker = null;
     }
     if (ReceiptImageTextField != null)
     {
         ReceiptImageTextField.Dispose();
         ReceiptImageTextField = null;
     }
     if (ReportNameLabel != null)
     {
         ReportNameLabel.Dispose();
         ReportNameLabel = null;
     }
     if (ReportNameTextField != null)
     {
         ReportNameTextField.Dispose();
         ReportNameTextField = null;
     }
     if (StatusLabel != null)
     {
         StatusLabel.Dispose();
         StatusLabel = null;
     }
     if (VendorLabel != null)
     {
         VendorLabel.Dispose();
         VendorLabel = null;
     }
     if (VendorTextField != null)
     {
         VendorTextField.Dispose();
         VendorTextField = null;
     }
 }
        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();
        }