public TaskDetailsModel(string id_task) { task = taskProvider.getTask(id_task).Result; this.stageDTO = processManagmentProvider.getStage(task.stage_id).Result; createdBy = userProvider.getUserbyID(task.createdBy).Result; taskState = taskProvider.getTaskState(task.taskState_id).Result; taskType = taskProvider.getTaskType(task.type_id).Result; if (taskType.needConfirm == "True") { taskResponsablesModel = new TaskResponsablesModel(task); } if (taskType.formNeeded == "True") { formQuestionsModel = new FormQuestionsModel(task); } }
public ActionResult _AddTaskQuestion(Model.FormQuestionsModel pModel) { if (ModelState.IsValid) { TaskQuestionDTO taskQuestion = new TaskQuestionDTO(); taskQuestion.question = pModel.questionA; taskQuestion.questionType_id = pModel.selected_questionType_idA; taskQuestion.taskForm_id = pModel.id_taskFormA; taskQuestion.questionPosition = pModel.maxQuestionPositionA.ToString(); taskQuestion.isRequired = pModel.isRequired == "on" ? "True": "False"; if (taskQuestion.questionType_id == "3") { taskQuestion.generalAttributeList = pModel.selected_attribute_idA; } taskQuestion.userLog = Request.Cookies["user_id"].Value; if (taskProvider.postFormQuestion(taskQuestion).Result) { return(_TaskQuestions(pModel.id_taskA)); } } return(new HttpStatusCodeResult(404, "Can't find that")); }