Ejemplo n.º 1
0
        public ActionResult ChangeEmail(EditEmail model)
        {
            var userId = UserData.UserId;

            try
            {
                var result = EditEmail.ChangeEmail(userId, model.Email, model.Password);

                if (result)
                {
                    ViewBag.Msg    = Resources.Resources.Notify_EmailChangeSuccess;
                    ViewBag.Status = "Success";
                }
                else
                {
                    ViewBag.Msg    = Resources.Resources.Notify_EmailChangeWrongPassword;
                    ViewBag.Status = "Error";
                }
            }
            catch (Exception)
            {
                ViewBag.Msg    = Resources.Resources.Notify_EmailChangeError;
                ViewBag.Status = "Error";
            }

            return(PartialView("~/Views/User/_SettingsChangeResult.cshtml"));
        }
Ejemplo n.º 2
0
        public ActionResult changeEmail()
        {
            // User.Identity.GetUserId();
            var       y  = User.Identity.GetUserId();
            EditEmail ed = new EditEmail();

            ed.oldEmail = db.Users.Where(x => x.Id == y).FirstOrDefault().Email;
            ProfileVM profileVM = new ProfileVM();

            profileVM.EditEmail = ed;

            return(PartialView(profileVM));
        }
        public async Task <IResponseContent> EditEmailAsync(EditEmail email, string tenantUid, string origin, string token)
        {
            try
            {
                IRestResponse response = await SubmitPostAsync(URL_CHANGE_EMAIL, origin, email, token, tenantUid);

                return(await AssertResponseContentAsync <EditEmailResponseContent>(response));
            }
            catch (Exception ex)
            {
                return(new EditEmailResponseContent
                {
                    Exception = ex
                });
            }
        }
        public async Task <JsonResult> EditEmail(string tenantUid, string username, string customerToken, string email, string language)
        {
            var origin          = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var verificationUrl = new Uri(new Uri(origin), helper.GetConfirmVerificationUrl(tenantUid, origin, email, language));

            var newEmail = new EditEmail
            {
                Username        = LoginSession.Username,
                Email           = email,
                VerificationUrl = verificationUrl.ToString()
            };
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);

            var response = await apiService.EditEmailAsync(newEmail, tenantUid, origin, customerToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public override void OnBindElements(View view)
        {
            EditDetailsAvatar    = view.FindViewById <ImageView>(Resource.Id.EditDetailsAvatar);
            EditDetailsSetAvatar = view.FindViewById <ImageButton>(Resource.Id.EditDetailsSetAvatar);
            EditEmail            = view.FindViewById <EditText>(Resource.Id.EditEmail);
            EditPassword         = view.FindViewById <EditText>(Resource.Id.EditPassword);
            EditPasswordConfirm  = view.FindViewById <EditText>(Resource.Id.EditPasswordConfirm);

            EditEmail.AddTextChangedListener(this);
            EditPassword.AddTextChangedListener(this);
            EditPasswordConfirm.AddTextChangedListener(this);
            EditDetailsSetAvatar.SetOnClickListener(this);
            EditEmail.Text           = Entity.Email;
            EditPasswordConfirm.Text = EditPassword.Text;

            if (Entity.Avatar == null)
            {
                Entity.Avatar = Constants.DefaultBase64PngUserAvatar;
            }

            Helpers.Helpers.Decode64StringAndSetImage(Entity.Avatar, EditDetailsAvatar);
        }
Ejemplo n.º 6
0
 public void ClickEditEmail()
 {
     EditEmail.Click();
 }
Ejemplo n.º 7
0
 public void ClearClickInputEditEmail(string NewEmail)
 {
     EditEmail.Clear();
     EditEmail.Click();
     EditEmail.SendKeys(NewEmail);
 }
Ejemplo n.º 8
0
 public void InputEditEmail(string NewEmail)
 {
     EditEmail.SendKeys(NewEmail);
 }
Ejemplo n.º 9
0
 public void ClrearEditEmail()
 {
     EditEmail.Clear();
 }