public async Task <IActionResult> Create(PageCreateGet Page) { var CurrentUser = await _userManager.GetUserAsync(User); Page.UserId = CurrentUser.Id; if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString())) { //var CheckString = await _userPageProvider.UserPageCreatePostCheck(Page); //if (CheckString.Length == 0) //{ _frontUserPageProvider.CreatePost(Page); return(Ok(Page)); //} return(BadRequest(new { IsSuccess = false, //Message = CheckString, })); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
public async Task <IActionResult> Create(PageCreateGet Page) { var token = HttpContext.Session.GetString("Token"); if (token == null) { return(RedirectToAction("Login", "FrontAuth")); } var PageCreateGetWithErrorMessage = await _client.PostProtectedAsync <PageCreateGetWithErrorMessages>($"{_configuration["APIUrl"]}api/Page/Create", Page, token); if (PageCreateGetWithErrorMessage.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 = PageCreateGetWithErrorMessage.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/Page/Create", token); //ViewBag.Env = _hostingEnv.EnvironmentName; //ViewBag.ErrorMessages = PageCreateGetWithErrorMessage.ErrorMessages; return(View(PageCreateGetWithErrorMessage.Page)); } return(RedirectToAction("Index")); }
public async Task <IActionResult> Create() { var CurrentUser = await _userManager.GetUserAsync(User); if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString())) { var PageCreateGet = new PageCreateGet(); var Statuses = await _masterListProvider.StatusList(CurrentUser.Id); var Projects = await _projectProvider.List(CurrentUser.Id); var Organizations = await _organizationProvider.List(CurrentUser.Id); var Classifications = await _classificationProvider.List(CurrentUser.Id); var Users = await _userProvider.List(); var UserLanguage = await _masterProvider.UserLanguageUpdateGet(CurrentUser.Id); PageCreateGet.LanguageId = UserLanguage.LanguageId; PageCreateGet.LanguageName = UserLanguage.Name; PageCreateGet.Statuses = Statuses; PageCreateGet.Projects = Projects; PageCreateGet.Organizations = Organizations; PageCreateGet.Classifications = Classifications; PageCreateGet.Users = Users; return(Ok(PageCreateGet)); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
public async Task <IActionResult> Create(PageCreateGet Page) { var CurrentUser = await _userManager.GetUserAsync(User); Page.UserId = CurrentUser.Id; var ErrorMessages = new List <ErrorMessage>(); if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString())) { ErrorMessages = await _pageProvider.CreatePostCheck(Page); if (ErrorMessages.Count > 0) { Page = await CreateAddDropDownBoxes(Page, CurrentUser.Id); } else { _pageProvider.CreatePost(Page); } PageCreateGetWithErrorMessages PageWithErrorMessage = new PageCreateGetWithErrorMessages { Page = Page, ErrorMessages = ErrorMessages }; return(Ok(PageWithErrorMessage)); } ErrorMessages = await _checkProvider.NoRightsMessage(CurrentUser.Id); PageCreateGetWithErrorMessages PageWithNoRights = new PageCreateGetWithErrorMessages { Page = Page, ErrorMessages = ErrorMessages }; return(Ok(PageWithNoRights)); }
public async Task <string> CreatePost(PageCreateGet Page) { string usp = "usp_UserPageCreatePost @ShowTitleName , @ShowTitleDescription , @UserId , @Name , @Description , @MenuName , @MouseOver , @TitleName , @TitleDescription "; var CheckString = await _sqlDataAccess.LoadSingleRecord <string, dynamic>(usp, Page); return(CheckString); }
public async Task <List <ErrorMessage> > CreatePostCheck(PageCreateGet Page) { string usp = "usp_PageCreatePostCheck @LanguageID, @name, @UserId "; var ErrorMessages = await _sqlDataAccess.LoadData <ErrorMessage, dynamic>(usp, Page); return(ErrorMessages); }
public async Task <IActionResult> Create(PageCreateGet Page) { var token = HttpContext.Session.GetString("Token"); if (token == null) { return(RedirectToAction("Login", "FrontAuth")); } await _client.PostProtectedAsync <PageCreateGet>($"{_configuration["APIUrl"]}api/FrontUserPage/Create", Page, token); return(RedirectToAction("Index")); }
public async Task <string> CreatePost(PageCreateGet Page) { string usp = "usp_PageCreatePost @ShowTitleName , @ShowTitleDescription , @StatusId, @Name, @Description , @MenuName , @MouseOver , @TitleName , @TitleDescription , @UserId,@OrganizationId, @ProjectId,@ClassificationId, @SelectedUserId "; // string usp = "usp_PageCreatePost @LanguageId, @Name, @Description, @MenuName, @MouseOver, @TitleName, @TitleDescription, @UserId"; var CheckString = await _sqlDataAccess.LoadSingleRecord <string, dynamic>(usp, Page); return(CheckString); }
public async Task <IActionResult> Create() { var CurrentUser = await _userManager.GetUserAsync(User); if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString())) { var Page = new PageCreateGet(); Page = await CreateAddDropDownBoxes(Page, CurrentUser.Id); return(Ok(Page)); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
private async Task <PageCreateGet> CreateAddDropDownBoxes(PageCreateGet Page, string UserId) { var Statuses = await _masterListProvider.StatusList(UserId); var Projects = await _projectProvider.List(UserId); var Organizations = await _organizationProvider.List(UserId); var Classifications = await _classificationProvider.List(UserId); var Users = await _userProvider.List(); var UserLanguage = await _masterProvider.UserLanguageUpdateGet(UserId); Page.LanguageId = UserLanguage.LanguageId; Page.LanguageName = UserLanguage.Name; Page.Statuses = Statuses; Page.Projects = Projects; Page.Organizations = Organizations; Page.Classifications = Classifications; Page.Users = Users; Page.StatusId = 1; return(Page); }