예제 #1
0
        public virtual ActionResult LCTask(string operationNumber, TaskDataModel model)
        {
            var database      = new OptimaContainer();
            var splittedFolio = model.TaskFolio.Split('-');
            var taskId        = splittedFolio[splittedFolio.Length - 1];
            var taskName      = _lcTaskService.GetTaskName(taskId).Name;

            var TaskViewModel = new TasksViewModel
            {
                TaskName      = taskName,
                Instructions  = LifeCycleGlobalValues.INSTRUCTIONS_LC,
                TaskDataModel = model,
                UserName      = IDBContext.Current.UserName
            };

            ViewBag.SerializedViewModel = IDB.Presentation.MVC4.Helpers.PageSerializationHelper.SerializeObject(TaskViewModel);
            return(View(TaskViewModel));
        }
예제 #2
0
        string RunOldRulesEngine(
            IRuleEvaluatorService ruleService,
            string code,
            int operationId,
            int contractId,
            string mainOperationNumber,
            int clauseId,
            int clauseIndividualId,
            string clauseExtensionId,
            decimal amount)
        {
            Dictionary <string, string> variablesList = new Dictionary <string, string>();

            variablesList.Add("OperationId", operationId.ToString());
            variablesList.Add("ContractId", contractId.ToString());
            variablesList.Add("MainOperationNumber", mainOperationNumber);

            using (var dbOptimaContainer = new OptimaContainer())
            {
                variablesList.Add("ValidationStageAprobId", dbOptimaContainer.ConvergenceMasterData
                                  .Where(a => a.Code == ClauseConstants.APPROVED_CLAUSE_STATUS).ToString());
            }

            variablesList.Add("ClauseId", clauseId.ToString());
            variablesList.Add("ClauseIndividualId", clauseIndividualId.ToString());
            variablesList.Add("ClauseExtensionId", clauseExtensionId);
            variablesList.Add("Role", string.Empty);
            variablesList.Add("Temp", string.Empty);

            string validatorCandidates = ruleService.EvaluateST(int.Parse(code), variablesList, amount);

            if (!validatorCandidates.Contains("Error"))
            {
                validatorCandidates = validatorCandidates.Replace("\"", string.Empty);
            }

            return(validatorCandidates);
        }