コード例 #1
0
        public async Task <JsonResult> UserDetail()
        {
            SettingsController settingsController = this;
            string             userId             = HttpContext.Session.GetString(SessionKeyManager.Login);
            AppUser            byIdAsync          = await settingsController._userManager.FindByIdAsync(userId);

            return(settingsController.Json((object)new UserDetailResponse()
            {
                CompanyName = byIdAsync.AuthorizedPerson
            }));
        }
コード例 #2
0
        public async Task <IActionResult> Update()
        {
            SettingsController settingsController = this;
            string             userId             = HttpContext.Session.GetString(SessionKeyManager.Login);
            AppUser            byIdAsync          = await settingsController._userManager.FindByIdAsync(userId);

            return((IActionResult)settingsController.View((object)new ListDealerResponse()
            {
                Address = byIdAsync.Address,
                CompanyName = byIdAsync.CompanyName,
                Email = byIdAsync.Email,
                Phone = byIdAsync.PhoneNumber,
                Authorized = byIdAsync.AuthorizedPerson
            }));
        }
コード例 #3
0
        public async Task <JsonResult> UpdatePassword([FromBody] UpdateDealerPasswordRequest request)
        {
            SettingsController settingsController = this;
            BaseResponse       baseResponse       = new BaseResponse();
            string             userId             = HttpContext.Session.GetString(SessionKeyManager.Login);
            AppUser            byIdAsync          = await settingsController._userManager.FindByIdAsync(userId);

            if ((await settingsController._userManager.ChangePasswordAsync(byIdAsync, request.CurrentPassword, request.NewPassword)).Succeeded)
            {
                baseResponse.Number  = 1;
                baseResponse.Message = "Şifreniz Başarıyle Değiştirilmiştir..";
                return(settingsController.Json((object)baseResponse));
            }
            baseResponse.Number  = 2;
            baseResponse.Message = "Eski Şifrenizi Yanlış Girdiniz..";
            return(settingsController.Json((object)baseResponse));
        }
コード例 #4
0
        public async Task <JsonResult> UpdateDealer([FromBody] UpdateDealerRequest request)
        {
            SettingsController settingsController = this;
            BaseResponse       response           = new BaseResponse();
            string             userId             = HttpContext.Session.GetString(SessionKeyManager.Login);
            AppUser            byIdAsync          = await settingsController._userManager.FindByIdAsync(userId);

            byIdAsync.Email            = request.Email;
            byIdAsync.UserName         = request.Email;
            byIdAsync.PhoneNumber      = request.Phone;
            byIdAsync.Address          = request.Address;
            byIdAsync.CompanyName      = request.CompanyName;
            byIdAsync.AuthorizedPerson = request.Authorized;
            if ((await settingsController._userManager.UpdateAsync(byIdAsync)).Succeeded)
            {
                response.Message = "Bilgiler Başarıyla Değiştirilmiştir..";
                response.Number  = 1;
                return(settingsController.Json((object)response));
            }
            response.Message = "Bu Email Adresi Kayıtlıdır.Lütfen Farklı Bir Email Adresi Giriniz";
            response.Number  = 2;
            return(settingsController.Json((object)response));
        }