private EvaluationTrackingModel InitEvaluationItem(string operationNumber) { var listApprovedOrNA = ClientEvaluationTracking .VerifyOperationApproved(operationNumber, IDBContext.Current.CurrentLanguage); var listItems = new List <SelectListItem>(); listItems.Add(new SelectListItem { Text = listApprovedOrNA[0].Name, Value = Convert.ToString(listApprovedOrNA[0].ConvergenceMasterDataId), Selected = true }); ViewBag.CodeNotChangedReason = listApprovedOrNA[0].Code; ViewBag.itemAprrovedOrNA = listItems; int idMatrix = ClientEvaluationTracking.GetResultsMatrix(operationNumber); EvaluationTrackingModel model = LoadDropDownList(); var demMethodology = model.GetMethodologyDem.ToList(); foreach (var item in demMethodology) { if (!listItems.Any(x => x.Value == item.ConvergenceMasterDataId.ToString())) { model.GetMethodologyDem.Remove(item); } } model.ResultsMatrixId = idMatrix; model.OperationNumber = operationNumber; model.MethodologyCurrentId = model.GetMethodologyCurrent[0].ConvergenceMasterDataId; FilterStage(model); model.ResultsMatrix = ClientEvaluationTracking.GetHeaderResultsMatrix(operationNumber); return(model); }
public virtual ActionResult EditEvaluationTracking(string operationNumber) { var listApprovedOrNA = ClientEvaluationTracking .VerifyOperationApproved(operationNumber, IDBContext.Current.CurrentLanguage); ViewBag.CodeNotChangedReason = listApprovedOrNA[0].Code; int idMatrix = ClientEvaluationTracking.GetResultsMatrix(operationNumber); List <EvaluationTrackingModel> model = ClientEvaluationTracking .GetDetailsModel(operationNumber, IDBContext.Current.CurrentLanguage); EvaluationTrackingModel loadDropDownList = LoadDropDownList(); List <EvaluationTrackingModel> itemModel = new List <EvaluationTrackingModel>(); foreach (var item in model) { item.GetTopicIntervention = loadDropDownList.GetTopicIntervention; item.GetTopicEvaluation = loadDropDownList.GetTopicEvaluation; item.GetMethodologyDem = loadDropDownList.GetMethodologyDem; item.GetMainTopicEvaluation = loadDropDownList.GetTopicEvaluation; item.GetMainTopicIntervention = loadDropDownList.GetTopicIntervention; item.GetMethodologyCurrent = loadDropDownList.GetMethodologyCurrent; item.GetStage = loadDropDownList.GetStage; item.GetResponsible = loadDropDownList.GetResponsible; item.GetSourceOfFunding = loadDropDownList.GetSourceOfFunding; item.GetTypeDocument = loadDropDownList.GetTypeDocument; item.GetDocumentPermission = loadDropDownList.GetDocumentPermission; item.GetTypeDocumentString = loadDropDownList.GetTypeDocumentString; item.GetAllStageString = loadDropDownList.GetAllStageString; itemModel.Add(item); } var templateModel = InitEvaluationItem(operationNumber); templateModel.EvaluationTrackingId = -1; itemModel.Add(templateModel); return(View(itemModel)); }