public virtual ActionResult SupervisionReportStep1(string operationNumber, bool isEditable, int versionId = 0, bool isNew = false) { base.SetViewBagRoles(operationNumber); var jsonResult = base.TryAccessToResources(URL_SUPERVISION_REPORT_STEP1, operationNumber, versionId); if (jsonResult != null) { TempData["ErrorMessage"] = ((dynamic)jsonResult).ErrorMessage; return(RedirectToAction("SupervisionReportDashboard", new { operationNumber })); } var model = GetSupervisionReportPage1(operationNumber, isEditable, versionId); model.IsNew = isNew; if (!string.IsNullOrWhiteSpace(ViewBag.ErrorMessage)) { TempData["ErrorMessage"] = ((dynamic)jsonResult).ErrorMessage; return(RedirectToAction("SupervisionReportDashboard", new { operationNumber })); } ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); return(View(model)); }
public virtual ActionResult EditNegotiation(string operationNumber, int procurementId) { var identifier = string.Format("{0}-proc-{1}", operationNumber, procurementId); var errorMessage = SynchronizationHelper.AccessToResources(SynchronizationHelper.EDIT_MODE, SYNC_PROCUREMENT, identifier, IDBContext.Current.UserLoginName); if (!string.IsNullOrWhiteSpace(errorMessage)) { return(RedirectToAction("Read", new { procurementId = procurementId, tabName = TAB_NAME_NEGOTIATION, errorMessage = errorMessage, })); } ViewBag.ActiveTab = TAB_NAME_NEGOTIATION; var model = new FirmProcurementViewModel(); model = GetEditNegotiationData(operationNumber, procurementId); ViewBag.SerializedModel = PageSerializationHelper.SerializeObject(model.Negotiation); ViewBag.Modality = model.Header.Modality; ViewBag.ModalityId = model.Header.ModalityId; return(View("Edit", model)); }
public virtual ActionResult SubmitWorkflow(string resultMatrixId, bool isFinalReport) { Logger.GetLogger().WriteDebug( "WorkflowK2Controller", "Method: SubmitWorkflow - Parameters( resultMatrixId: " + resultMatrixId + ")"); var commentsResponse = _commentsTaskService.GetComments(Convert.ToInt32(resultMatrixId)); var modelTaskView = new WorkflowViewModels { UserComments = commentsResponse.IsValid ? commentsResponse.Comments : null, CountComments = commentsResponse.Comments.Count > 0 ? commentsResponse.Comments.Count : 0, Instructions = Convert.ToBoolean(isFinalReport) ? Localization.GetText("TCM.TR.TaskAndRequestFoundCoordinator.SubmitInstructions.IsFinalReport") : Localization.GetText("TCM.TR.TaskAndRequestFoundCoordinator.SubmitInstructions"), TaskDataModel = null, UserName = IDBContext.Current.UserName, ResultMatrixId = Convert.ToInt32(resultMatrixId), IsFinalReport = Convert.ToBoolean(isFinalReport) }; ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(modelTaskView); Logger.GetLogger().WriteDebug("WorkflowK2Controller", "Method: SubmitWorkflow - Final"); return(View("TaskDetailWorkflow", modelTaskView)); }
public virtual ActionResult GetRowRelatedOperation(string operationNumber) { var excludeRelationshipType = new List <string> { RelationshipTypeItself }; ViewBag.RelationshipType = _catalogService.GetListMasterData( MasterType.RELATIONSHIP_TYPE, true, excludeRelationshipType); var excludeRelationshipRole = new List <string> { RelationshipTypeItself }; ViewBag.RelationshipRole = _catalogService.GetListMasterData( MasterType.RELATIONSHIP_ROLE, excludeByCode: excludeRelationshipRole); var basicDataModel = _cacheManagement .Get <MW.Application.OPUSModule.ViewModels.OperationDataService.BasicDataViewModel>( "modelBasicDataOR"); _cacheManagement.Remove("modelBasicDataOR", System.Web.Caching.CacheItemRemovedReason.Removed); MW.Application.OPUSModule.ViewModels.OperationDataService.BasicDataViewModel model = basicDataModel; model = _productProfileService.GetRelatedOperation(model).BasicData; model.SerializedModel = PageSerializationHelper.SerializeObject(model); return(PartialView("EditPartial/_TableRelations", model)); }
public virtual ActionResult StarForm(string operationNumber, bool isEditable, int versionId = 0, bool isNew = false) { base.SetViewBagRoles(operationNumber); var jsonResult = base.TryAccessToResources(URL_STAR_FORM, operationNumber, versionId); if (jsonResult != null) { TempData["ErrorMessage"] = ((dynamic)jsonResult).ErrorMessage; return(RedirectToAction("StarDashboard", new { operationNumber })); } var model = GetStarViewModel(operationNumber, isEditable, versionId); model.IsNew = isNew; if (!string.IsNullOrWhiteSpace(ViewBag.ErrorMessage)) { TempData["ErrorMessage"] = Localization.GetText(ViewBag.ErrorMessage); return(RedirectToAction("StarDashboard", new { operationNumber })); } ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); return(View(model)); }
public virtual ActionResult VERTask(string operationNumber, TaskDataModel model) { var commentRequest = new CommentsTaskRequest { TaskId = model.TaskId }; var commentsResponse = _verTaskService.GetComments(commentRequest); var instructionRequest = new InstructionTaskRequest { TaskId = model.TaskId }; var instructionResponse = _verTaskService.GetInstruction(instructionRequest); var verTaskViewModel = new TaskViewModel { UserComments = commentsResponse.IsValid ? commentsResponse.Comments : null, Instructions = instructionResponse.IsValid ? instructionResponse.Instruction : null, TaskDataModel = model, UserName = IDBContext.Current.UserName }; ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(verTaskViewModel); return(View(verTaskViewModel)); }
public virtual ActionResult TaskDetail(TaskDataModel model) { var validatorsResponse = _k2DataService.GetValidators(model.Code, model.TaskFolio); var commentsResponse = _k2DataService.GetComments(model.WorkflowInstanceId); var additionalValidatorsResponse = _catalogService.GetMasterDataListByTypeCode(typeCodes: _k2DataService.AdditionalValidatorsRolesDataType); var modelTaskView = new MissionsK2TaskViewModel { UserComments = commentsResponse.IsValid ? commentsResponse.Comments : null, Instructions = Localization.GetText("Pending key multilanguage"), TaskDataModel = model, UserName = IDBContext.Current.UserName, Validators = validatorsResponse.IsValid ? validatorsResponse.Validators : null, UserRoleMissions = validatorsResponse.IsValid ? validatorsResponse.Validators.Where(v => v.Order > model.TaskTypeId).Select(v => v.Role).FirstOrDefault() : null }; ViewBag.AdditionalValidators = additionalValidatorsResponse.IsValid ? additionalValidatorsResponse.MasterDataCollection : new List <MasterDataViewModel>(); ViewBag.UserRole = validatorsResponse.IsValid ? validatorsResponse.Validators.Where(v => v.Order > model.TaskTypeId).Select(v => v.Role).FirstOrDefault() : null; ViewBag.UserName = IDBContext.Current.UserName; ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(modelTaskView); return(View(modelTaskView)); }
public virtual ActionResult DelegablePermissionTask( string userName, string[] operationNumbers, int delegationId, int?roleId, string[] countrys, string[] cDepartments, string[] departments, string[] divisions, string delegateUsername) { var model = _viewModelMapperHelper .GetDelegablePermissionsTasks( userName, operationNumbers, delegationId, roleId, countrys, cDepartments, departments, divisions, delegateUsername); ViewBag.SerializedViewModelNew = PageSerializationHelper.SerializeObject(model); ViewBag.IsNewDelegation = model.DelegationId.Equals(0); var isTeamMember = _delegationService.IsTeamMember(roleId); ViewBag.AssignSubDelegation = isTeamMember ? null : model.AssignSubDelegation; ViewBag.SubDelegationAllSelected = !isTeamMember && model.AssignSubDelegation.SubDelegationAllSelected; return(PartialView("Partial/Delegation/AssignPermissionsTask", model.AssignPermissionsTask)); }
public virtual ActionResult HighRiskForm(string operationNumber, bool isEditable, int versionId = 0, bool mostRecent = false) { SetViewBagRoles(operationNumber); var jsonResult = TryAccessToResources(URL_HIGH_RISK_FORM, operationNumber, versionId); if (jsonResult != null) { TempData["ErrorMessage"] = ((dynamic)jsonResult).ErrorMessage; return(RedirectToAction("HighRiskDashboard", new { operationNumber })); } var model = GetHighRiskViewModel(operationNumber, isEditable, versionId, mostRecent); if (!string.IsNullOrWhiteSpace(ViewBag.ErrorMessage)) { TempData["ErrorMessage"] = Localization.GetText(ViewBag.ErrorMessage); return(RedirectToAction("HighRiskDashboard", new { operationNumber })); } ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); if (!mostRecent && versionId != 0) { ViewBag.WriteRole = false; } return(View(model)); }
public virtual ActionResult EditTemplate(int templateId = 0) { var model = GetTemplateViewModel(templateId); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); return(View(model)); }
public virtual ActionResult SupervisionReportStep2(string operationNumber, bool isNew, int versionId = 0, int parentId = 0) { SetViewBagRoles(operationNumber); if (!ViewBag.WriteRole) { return(Json(new { ErrorMessage = Localization.GetText(NO_WRITE_PERMISSION) })); } var jsonResult = TryAccessToResources(URL_SUPERVISION_REPORT_STEP2, operationNumber, versionId); if (jsonResult != null) { return(jsonResult); } var model = GetSupervisionReportPage2(operationNumber, isNew, versionId, parentId); if (!string.IsNullOrWhiteSpace(ViewBag.ErrorMessage)) { return(Json(new { ErrorMessage = ViewBag.ErrorMessage })); } ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); ViewBag.UserName = IDBContext.Current.UserName; return(View(model)); }
public virtual ActionResult SearchControlInformationFilter( int searchPermissionId, int searchPageId, string searchCountryId, string searchDivisionId, string searchOperationType, string searchOperationStatus) { var response = _rolesAndPermissionsService.GetFieldTable(searchPermissionId, searchPageId, searchCountryId, searchDivisionId, searchOperationType, searchOperationStatus); ViewBag.SearchPermission = searchPermissionId.ToString(); ViewBag.SearchPageId = searchPageId.ToString(); ViewBag.PageTable = _rolesAndPermissionsService.GetPageList().ListResponse.Select(o => new SelectListItem { Value = o.Value, Text = o.Text }).ToList(); ViewBag.Field = _rolesAndPermissionsService.GetFieldList(response.ControlInformation.TableField.Select(o => o.Field)).ListResponse.Select(o => new SelectListItem { Value = o.Value, Text = o.Text }).ToList(); ViewBag.Country = _catalogService.GetListMultiMasterData(MasterType.COUNTRY, excludeByCode: new List <string> { CountryCode.UND }); ViewBag.Division = _catalogService.GetListMultiMasterData(MasterType.ORGANIZATION_UNIT, true); ViewBag.OperationType = _catalogService.GetListMultiMasterData(MasterType.OPERATION_TYPE); ViewBag.OperationStatus = _catalogService.GetListMultiMasterData(MasterType.OVERALL_STAGE); ViewBag.SerializedViewModelControl = PageSerializationHelper.SerializeObject(response.ControlInformation); return(PartialView("Partial/TableControlInformation", response.ControlInformation.TableField)); }
public virtual ActionResult GeneralInformationEdit(string operationNumber, string accessType) { SetViewBagRoles(operationNumber); if (!ViewBag.WriteRole) { return(Json(new { ErrorMessage = Localization.GetText(NO_WRITE_PERMISSION) })); } var errorMessage = SynchronizationHelper.AccessToResources(accessType, URL_GENERAL_INFORMATION, operationNumber, IDBContext.Current.UserLoginName); if (!string.IsNullOrWhiteSpace(errorMessage)) { return(Json(new { ErrorMessage = errorMessage })); } var model = GetGeneralInformation(operationNumber); if (!string.IsNullOrWhiteSpace(ViewBag.ErrorMessage)) { return(Json(new { ErrorMessage = ViewBag.ErrorMessage })); } ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); model.Members = GetMemberForEsgGroup(model.EsgGroupsConfiguration); return(PartialView("Partials/GeneralInformationPartial", model)); }
public virtual ActionResult PCRFollowUpTaskList(string operationNumber, string accessType) { var errorMessage = SynchronizationHelper.AccessToResources( accessType, UrlFollowUp, operationNumber, IDBContext.Current.UserName); if (!string.IsNullOrWhiteSpace(errorMessage)) { return(Json(new { ErrorMessage = errorMessage })); } ViewBag.SPDRole = _authorizationService.IsAuthorized( IDBContext.Current.UserLoginName, operationNumber, ActionEnum.PCRSPDLeaderWrite, true); ViewBag.IsModeEdit = accessType.Equals("edit") ? true : false; ViewBag.Documents = _viewModelMapperHelper .AddOptionsDocumentsDropDown(IDBContext.Current.CurrentLanguage); ViewBag.UserName = IDBContext.Current.UserName; var model = _viewModelMapperHelper.GetFollowUp(operationNumber); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); return(PartialView("Partials/PCRFollowUpTaskList", model)); }
// GET: FinancialPlan/FinancialPlan public virtual ActionResult Index(string operationNumber, string currentTabToBeLoaded) { var model = _financialPlanService.GetOperationLevel( operationNumber: operationNumber, currenTab: currentTabToBeLoaded, userName: IDBContext.Current.UserName, userExternalModel: IDBContext.Current.UserExternal); SetPermission(model); ViewBag.SerializedViewModelNew = PageSerializationHelper.SerializeObject(model); if (!string.IsNullOrWhiteSpace(model.ErrorMessage)) { return(View("FinancialError", model)); } if (string.IsNullOrEmpty(currentTabToBeLoaded)) { return(View(model)); } else { var data = new JsonResult { Data = new { TabView = this.RenderRazorViewToString("Partial/FinancialPlanInformation", model), Months = model.MonthTotal, fpMode = model.Mode } }; return(data); } }
public virtual ActionResult SafeguardToolkit4(string operationNumber, int versionId, bool isNew = false, SafeguardToolkitCreationModeEnum creationMode = SafeguardToolkitCreationModeEnum.NA) { var jsonResult = TryAccessToResources(URL_SAFEGUARD_TOOLKIT_4, operationNumber, versionId); if (jsonResult != null) { TempData["ErrorMessage"] = ((dynamic)jsonResult).ErrorMessage; return(RedirectToAction("SafeguardToolkit3", new { operationNumber })); } var model = GetSafeguardToolkitStep4ViewModel(operationNumber, creationMode, versionId, isNew); if (!string.IsNullOrWhiteSpace(ViewBag.ErrorMessage)) { TempData["ErrorMessage"] = ViewBag.ErrorMessage; return(RedirectToAction("SafeguardToolkit3", new { operationNumber, versionId })); } ViewBag.isNew = isNew; ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); ViewBag.CreationMode = creationMode; return(View(model)); }
public virtual ActionResult TemplatesPageEdit() { var model = GetTemplatesPageViewModel(); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); return(View(model)); }
public virtual ActionResult BackendBusinessRuleEditorPartial(string brCode) { var model = brCode != null?LoadBackendRule(brCode) : new BRERuleDTO(); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); return(PartialView("Partials/BackendBusinessRuleEditor/BackendBusinessRuleEditorPartial", model)); }
public virtual ActionResult RulesGroupCreateAndEdit( int searchModule, int searchGroupRule, int searchGroupClasification, string searchRuleName, int searchRuleGroupStatus, string searchClassificationCode) { ViewBag.fixLoad = true; ViewBag.RuleGroupModule = _ruleEngService.GetItemsRuleEngModuleCode(); var response = new RuleEngGroupViewModel { Name = string.Empty, Classification = string.Empty, Code = string.Empty, ClassificationId = 0, IsActive = false, CodeId = 0, GroupRuleId = 0, Module = string.Empty, ModuleId = 0, RuleEngGroupId = 0, GroupRule = string.Empty, BreakFirst = false, RuleEngResultGroupClassificationId = 0, RuleEngResult = new List <RuleEngResultViewModel>(), RuleEng = new List <RuleEngViewModel>(), RuleEngResultGroupClassification = new List <RuleEngResultGroupClassificationViewModel>() }; if (searchGroupRule != 0) { response = _ruleEngService .GetRulesGroupCreateAndEdit( searchGroupRule, searchModule, searchGroupClasification, searchRuleName, searchRuleGroupStatus, searchClassificationCode) .GetRuleEngGroup; } response.GroupRole = _ruleEngService.GetItemsGroup( searchGroupRule, RulesEngAttributes.RULE_GROUP).GetRuleEngGroup; response.GroupClassification = _ruleEngService.GetItemsGroup( searchGroupRule, RulesEngAttributes.CLASSIFICATION).GetRuleEngGroup; ViewBag.RuleEngCode = _ruleEngService.GetItemsRuleEngCode(searchGroupRule); ViewBag.ID = searchGroupRule; ViewBag.SerializedViewModel = PageSerializationHelper .SerializeObject(response); return(PartialView("Partials/RulesGroupEdit", response)); }
// GET: /BusinessRules/BackendBusinessRuleEditor/ public virtual ActionResult BackendBusinessRuleEditor(string brCode, bool editMode = false) { var model = brCode != null?LoadBackendRule(brCode) : new BRERuleDTO(); ViewBag.EditMode = editMode; ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); return(View(model)); }
public virtual ActionResult AttributeLayoutEditorEdit(int operationTypeId, int?relationshipId, int sectionId) { var response = _attributesEngineService .GetFormLayout(operationTypeId, relationshipId, sectionId, true); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(response.AttributeForm); return(PartialView("Partials/_AttributeLayoutEditorPartial", response.AttributeForm)); }
public virtual ActionResult Edit(int indicatorId = 0) { var model = GetIndicator(indicatorId); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); SetViewBag(); return(View(model)); }
public virtual ActionResult AttributeLayoutEditorByCode(string operationTypeCode, string relationshipCode, string sectionCode) { var response = _attributesEngineService .GetFormLayout(operationTypeCode, relationshipCode, sectionCode, true); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(response.AttributeForm); return(View("AttributeLayoutEditor", response.AttributeForm)); }
public virtual ActionResult SearchTemplates(string templateName, string type) { var model = _viewModelMapperHelper.GetTemplateRowViewModels(templateName, type); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); ViewBag.Type = type; return(PartialView("Partials/DataTableTemplate", model)); }
public virtual ActionResult SearchChartListByRol(string graphName, int?graphTypeId, int?role) { var model = _viewModelMapperHelper.GetListGraphByFilter(graphName, graphTypeId, role); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); ViewBag.RoleId = (role == null) ? string.Empty : role.ToString(); return(PartialView("Partials/DataTableRoles", model)); }
private TemplateViewModel DataTemplate(int templateId) { var model = _viewModelMapperHelper.GetTemplateData(templateId); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model.templateViewModel); ViewBag.TemplateId = templateId; return(model.templateViewModel); }
public virtual ActionResult Index(string operationNumber) { var model = _myMeetingsService.GetMyMeetings(operationNumber).MyMeetingsTable; ViewBag.SerializedVmrInstancesViewModel = PageSerializationHelper.SerializeObject(model); _viewModelMapperHelper.GetMyMeetingsViewModel(); return(View(model)); }
public virtual ActionResult MyMeetingsContent(string operationNumber) { var model = _myMeetingsService.GetMyMeetings(operationNumber).MyMeetingsTable; _viewModelMapperHelper.IsEditableScreen(true); ViewBag.SerializedVmrInstancesViewModel = PageSerializationHelper.SerializeObject(model); _viewModelMapperHelper.GetMyMeetingsViewModel(); return(PartialView("Partials/DataTables/MyMeetingsTable", model.MyMeetingsList)); }
public virtual ActionResult SupervisionReportDashboard(string operationNumber) { var model = GetSupervisionReportDashboard(operationNumber); SetViewBagRoles(operationNumber); ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(model); return(View(model)); }
public virtual ActionResult CreateWorkflow(string operationNumber) { var workflowType = _k2IntegrationOpus.GetWorkflowType(operationNumber); var operation = _creationFormService.GetOperation(operationNumber); var validators = _k2IntegrationOpus .GetRoleByOperationTypeVM( string.Empty, workflowType, operation.OperationData.OperationType.Code, operationNumber); if (!validators.IsValid) { return(View(new CreationK2TaskViewModel { Validators = validators.Models.ToList(), Instructions = string.Empty, OperationNumber = operationNumber })); } var commentsCreation = _k2DataService.GetCommentsCreation(operationNumber); var modelTaskView = new CreationK2TaskViewModel { UserComments = commentsCreation.IsValid ? commentsCreation.CommentList : null, Instructions = Localization.GetText("OP.CR.K2.StartWorkflow.Instructions"), UserName = IDBContext.Current.UserName, Validators = validators.Models.ToList(), OperationNumber = operationNumber }; var existsWorkflowTaskRegister = _workflowTaskRegisterRepository.Any(o => o.OperationNumber.Equals(operationNumber)); if (!existsWorkflowTaskRegister) { foreach (var validator in validators.Models) { var newWorkflowTaskRegister = new WorkflowTaskRegister { OperationNumber = operationNumber, StatusName = validator.Status, UserProfile = validator.Role }; _workflowTaskRegisterRepository.Create(newWorkflowTaskRegister); } } ViewBag.SerializedViewModel = PageSerializationHelper.SerializeObject(modelTaskView); return(View(modelTaskView)); }