public async Task <IActionResult> Update(PersonTelecomUpdateGet PersonTelecom)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            PersonTelecom.UserId = CurrentUser.Id;
            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                PersonTelecom.UserId = CurrentUser.Id;
                //var CheckString = await _PersonProvider.UpdatePostCheck(Person);
                //if (CheckString.Length == 0)
                //{
                _personTelecomProvider.UpdatePost(PersonTelecom);
                return(Ok(PersonTelecom));

                //}
                return(BadRequest(new
                {
                    IsSuccess = false,
                    //Message = CheckString,
                }));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Esempio n. 2
0
        public bool UpdatePost(PersonTelecomUpdateGet PersonTelecom)
        {
            string usp = "usp_PersonTelecomUpdatePost @PersonTelecomId  , @TelecomValue,@CountryCode, @AreaCode, @ExtensionCode,@AskForName, @UserId";

            _sqlDataAccess.SaveData <PersonTelecomUpdateGet>(usp, PersonTelecom);
            return(true);
        }
Esempio n. 3
0
        public async Task <List <ErrorMessage> > UpdatePostCheck(PersonTelecomUpdateGet PersonTelecom)
        {
            string usp           = "usp_PersonTelecomUpdatePostCheck @PersonTelecomId  , @TelecomValue,@CountryCode, @AreaCode, @ExtensionCode,@AskForName, @UserId";
            var    ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, PersonTelecom);

            return(ErrorMessages);
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(PersonTelecomUpdateGet PersonTelecom)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var PersonTelecomUpdateGetWithErrorMessage = await _client.PostProtectedAsync <PersonTelecomUpdateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/PersonTelecom/Update", PersonTelecom, token);

            if (PersonTelecomUpdateGetWithErrorMessage.ErrorMessages.Count > 0)
            {
                var AllStuff = await _loadViewBagModel.ViewBagLoad(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), token, _hostingEnv.EnvironmentName, _configuration, false, 0, "");

                AllStuff.ErrorMessages = PersonTelecomUpdateGetWithErrorMessage.ErrorMessages;
                ViewBag.AllStuff       = AllStuff;
                //ViewBag.Favorites = await _client.GetProtectedAsync<List<MVCFavoriteMenu>>($"{_configuration["APIUrl"]}api/MVCFavorite/Menu", token);
                //ViewBag.FavoriteGroupList = await _client.GetProtectedAsync<List<MVCFavoriteGroupList>>($"{_configuration["APIUrl"]}api/MVCFavorite/GroupList", token);
                //ViewBag.UITerms = await _client.GetProtectedAsync<List<UITermLanguageCustomizationList>>($"{_configuration["APIUrl"]}api/MVC/PersonTelecom/Edit", token);
                //ViewBag.Env = _hostingEnv.EnvironmentName;

                //ViewBag.ErrorMessages = PersonTelecomUpdateGetWithErrorMessage.ErrorMessages;
                return(View(PersonTelecomUpdateGetWithErrorMessage.PersonTelecom));
            }

            return(RedirectToAction("Index", new { id = PersonTelecom.PersonId }));
        }
        public async Task <IActionResult> Index(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                PersonTelecomUpdateGet PersonTelecom = await _personTelecomProvider.UpdateGet(CurrentUser.Id, Id);

                PersonTelecom = await UpdateAddDropDownBoxes(PersonTelecom, CurrentUser.Id);

                return(Ok(PersonTelecom));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Esempio n. 6
0
        public async Task <IActionResult> Edit(PersonTelecomUpdateGet PersonTelecom)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var PersonTelecomUpdateGetWithErrorMessage = await _client.PostProtectedAsync <PersonTelecomUpdateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/FrontPersonTelecom/Update", PersonTelecom, token);

            if (PersonTelecomUpdateGetWithErrorMessage.ErrorMessages.Count > 0)
            {
                ViewBag.Favorites = await _client.GetProtectedAsync <List <MVCFavoriteMenu> >($"{_configuration["APIUrl"]}api/MVCFavorite/Menu", token);

                ViewBag.FavoriteGroupList = await _client.GetProtectedAsync <List <MVCFavoriteGroupList> >($"{_configuration["APIUrl"]}api/MVCFavorite/GroupList", token);

                ViewBag.UITerms = await _client.GetProtectedAsync <List <UITermLanguageCustomizationList> >($"{_configuration["APIUrl"]}api/MVC/FrontPersonTelecom/Edit", token);

                ViewBag.Env = _hostingEnv.EnvironmentName;

                ViewBag.ErrorMessages = PersonTelecomUpdateGetWithErrorMessage.ErrorMessages;
                return(View(PersonTelecomUpdateGetWithErrorMessage.PersonTelecom));
            }

            return(RedirectToAction("Index", new { id = PersonTelecom.PersonId }));
        }
 private async Task <PersonTelecomUpdateGet> UpdateAddDropDownBoxes(PersonTelecomUpdateGet PersonTelecom, string UserId)
 {
     return(PersonTelecom);
 }