public async Task <IActionResult> Create(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())) { //PETER TODO add security with message like missing in contentcondition var PageSectionProcessConditionCreateGet = new PageSectionProcessConditionCreateGet(); PageSectionProcessConditionCreateGet.PageSectionProcessConditionTypes = await _pageSectionProcessConditionTypeProvider.ListExtended(CurrentUser.Id); PageSectionProcessConditionCreateGet.ProcessTypes = await _processTypeProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.ProcessTypeGroups = await _processTypeGroupProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.Organizations = await _organizationProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.Projects = await _projectProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.Roles = await _roleProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.SecurityLevels = await _securityLevelProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.Users = await _userProvider.List(); PageSectionProcessConditionCreateGet.ProcessTypeStageTypes = await _processTypeStageTypeProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.Languages = await _languageProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.Persons = await _personProvider.List(); PageSectionProcessConditionCreateGet.Contents = await _contentProvider.List(); PageSectionProcessConditionCreateGet.ContentTypes = await _contentTypeProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.ContentTypeGroups = await _contentTypeGroupProvider.List(CurrentUser.Id); //PageSectionProcessConditionCreateGet.ProcessTypes = await _ProcessTypeProvider.List(CurrentUser.Id); //PageSectionProcessConditionCreateGet.ProcessStatuses = await _ProcessStatusProvider.List(CurrentUser.Id); PageSectionProcessConditionCreateGet.Classifications = await _pageSectionProcessConditionProvider.CreateGetClassifications(CurrentUser.Id); for (int i = 0; i < PageSectionProcessConditionCreateGet.Classifications.Count(); i++) { PageSectionProcessConditionCreateGet.Classifications[i].ClassificationValues = await _pageSectionProcessConditionProvider.CreateGetClassificationValues(CurrentUser.Id, PageSectionProcessConditionCreateGet.Classifications[i].ClassificationId); } PageSectionProcessConditionCreateGet.PageSectionId = Id; //PageSectionProcessConditionCreateGet.Classifications = await _classificationProvider.List(CurrentUser.Id); // var PageSectionCreateGetSequences = await _pageSectionProvider.CreateGetSequence(CurrentUser.Id, Id); var SortBys = await _masterListProvider.SortByList(CurrentUser.Id); // PageSectionCreateGet.Sequences = PageSectionCreateGetSequences; return(Ok(PageSectionProcessConditionCreateGet)); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
private async Task <OrganizationPositionCreateGet> CreateAddDropDownBoxes(OrganizationPositionCreateGet OrganizationPosition, string UserId, int OrganizationId) { var Positions = await _positionProvider.List(UserId); var Persons = await _personProvider.List(); //PETER TODO --Should exclude maybe some persons and positions OrganizationPosition.Positions = Positions; OrganizationPosition.Persons = Persons; OrganizationPosition.OrganizationId = OrganizationId; return(OrganizationPosition); }
public async Task <IActionResult> AdvancedSearch() { 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 ProjectAdvancedSearch = new ProjectAdvancedSearchPost(); ProjectAdvancedSearch.SecurityLevels = await _securityLevelProvider.List(CurrentUser.Id); ProjectAdvancedSearch.ParentProjects = await _projectProvider.List(CurrentUser.Id); ProjectAdvancedSearch.Statuses = await _masterListProvider.StatusList(CurrentUser.Id); ProjectAdvancedSearch.ProjectTypes = await _projectTypeProvider.List(CurrentUser.Id); ProjectAdvancedSearch.Persons = await _personProvider.List(); // ProjectAdvancedSearch = await _projectProvider.FrontProjectAdvancedSearchGet(CurrentUser.Id); return(Ok(ProjectAdvancedSearch)); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
private async Task <PersonRelationCreateGet> CreateAddDropDownBoxes(PersonRelationCreateGet PersonRelation, string UserId) { var PersonRelationTypes = await _personRelationTypeProvider.List(UserId); var Persons = await _personProvider.List(); PersonRelation.PersonRelationTypes = PersonRelationTypes; PersonRelation.Persons = Persons; return(PersonRelation); }
public async Task <IActionResult> AdvancedSearch() { 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 ClassificationValueSearch = new ClassificationValueAdvancedSearchPost(); ClassificationValueSearch.DateLevels = await _dateLevelProvider.List(CurrentUser.Id); ClassificationValueSearch.Classifications = await _classificationProvider.List(CurrentUser.Id); ClassificationValueSearch.Persons = await _personProvider.List(); return(Ok(ClassificationValueSearch)); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
public async Task <IActionResult> Create(int Id) { var CurrentUser = await _userManager.GetUserAsync(User); var testifallowed = new FrontProcessNewProcessLogic(_userProvider, _processProvider, _frontProcessProvider); if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString())) //11 { List <NewProcessTypeList> x = await testifallowed.ReturnProcessTypeList(CurrentUser); if (x.Exists(x => x.ProcessTypeId == Id)) { //TOFIX PETER var newprocess = await _processProvider.CreateGet(CurrentUser.Id, Id); var newProcessWithMaster = new FrontProcessNewProcessWithMaster(); newProcessWithMaster.ProcessTypeId = Id; newProcessWithMaster.ProcessFields = newprocess; foreach (var y in newprocess) { if (y.ProcessTypeStageFieldStatusId == 4) { var xd = @$ "function {y.ControlIdOnFocusOutFunction.Trim()} {{var x = document.getElementById('{y.ControlId.Trim()}');console.log(x);if (x.value==='') {{ document.getElementById('{y.ControlIdWarning.Trim()}').style.display = 'block';}}else{{ document.getElementById('{y.ControlIdWarning.Trim()}').style.display = 'none';}}}}"; //var xd = @$"function {y.ControlIdOnFocusOutFunction.Trim()} {{var x = document.getElementById('{y.ControlId.Trim()}');if (x.value==='') {{alert('{y.MissingValueText.Trim()}a');}}else{{alert('{y.MissingValueText.Trim()}b');}}}}"; // var xe = String.Format($"function {0} {{var x = document.getElementById(\"{1}\");if (x.value===\"\") {{alert(\"{2}\");}}}}", y.ControlIdOnFocusOutFunction.Trim(), y.ControlId.Trim(), y.MissingValueText.Trim()); newProcessWithMaster.ErrorHandlingScript = newProcessWithMaster.ErrorHandlingScript + xd; //@"function " + //y.ControlIdOnFocusOutFunction + @" {var x = document.getElementById("""+ //y.ControlId + "\");if (x.value===\"\") {alert(\"" + //y.MissingValueText + "\");}}"; } } //for(int i = 0; i < newprocess.Count; i++) //{ //if(newprocess[i].ValueUpdateTypeId==2 && new[] { 1, 2 }.Contains(newprocess[i].ProcessTypeFieldTypeId)) // { // newprocess[i].StringValue // } //} if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 12) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 13)) { var Users = await _userProvider.List(); newProcessWithMaster.Users = Users; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 14) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 15)) { var organizations = await _organizationProvider.List(CurrentUser.Id); newProcessWithMaster.Organizations = organizations; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 16) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 17)) { var projects = await _projectProvider.List(CurrentUser.Id); newProcessWithMaster.Projects = projects; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 18) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 19)) { var Languages = await _languageProvider.List(CurrentUser.Id); newProcessWithMaster.Languages = Languages; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 20) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 21)) { var Classifications = await _classificationProvider.List(CurrentUser.Id); newProcessWithMaster.Classifications = Classifications; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 22) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 23)) { var ClassificationValues = await _classificationValueProvider.List(CurrentUser.Id); newProcessWithMaster.ClassificationValues = ClassificationValues; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 24) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 25)) { var Contents = await _contentProvider.List(); newProcessWithMaster.Contents = Contents; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 26) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 27)) { var Countries = await _masterListProvider.CountryList(CurrentUser.Id); newProcessWithMaster.Countries = Countries; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 28) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 29)) { var SecurityLevels = await _securityLevelProvider.List(CurrentUser.Id); newProcessWithMaster.SecurityLevels = SecurityLevels; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 30) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 31)) { var Roles = await _roleProvider.List(CurrentUser.Id); newProcessWithMaster.Roles = Roles; } if (newprocess.Exists(x => x.ProcessTypeFieldTypeId == 36) || newprocess.Exists(x => x.ProcessTypeFieldTypeId == 37)) { var Persons = await _personProvider.List(); newProcessWithMaster.Persons = Persons; } return(Ok(newProcessWithMaster));// CurrentUser.LanguageId)); } } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }