public ActionResult AnaliticPageView(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var expertiseStage = new ExpertiseStageRepository().GetById(id); if (expertiseStage == null) { return(HttpNotFound()); } var repository = new ReadOnlyDictionaryRepository(); var employee = UserHelper.GetCurrentEmployee(); var model = new DrugAnaliticEntity { EXP_DrugDeclaration = expertiseStage.EXP_DrugDeclaration, DrugDeclarationId = expertiseStage.DeclarationId.ToString(), Applicant = new EmployeesRepository().GetById(expertiseStage.EXP_DrugDeclaration.OwnerId), Editor = employee, ExpExpertiseStageRemarks = new List <EXP_ExpertiseStageRemark>(), ExpStageId = expertiseStage.Id, CurrentStage = new StageModel() { CurrentStage = GetExpertiseStage(expertiseStage.Id), StageResults = repository.GetStageResultsByStage(expertiseStage.StageId) } }; var employeName = ""; if (UserHelper.GetCurrentEmployee() != null) { employeName = UserHelper.GetCurrentEmployee().DisplayName; } ViewBag.CurrentEmployeeName = employeName; var markList = new DrugDeclarationRepository().GetPrimaryMarkList(expertiseStage.DeclarationId, CodeConstManager.STAGE_ANALITIC); var remarkTypes = repository.GetRemarkTypes().ToArray(); ViewData["RemarkTypes" + model.DrugDeclarationId] = new SelectList(remarkTypes, "Id", "NameRu", null); foreach (var expDrugPrimaryRemark in markList) { model.ExpExpertiseStageRemarks.Add(expDrugPrimaryRemark); } foreach (var expDrugPrimaryRemark in model.ExpExpertiseStageRemarks) { ViewData["RemarkTypes" + model.DrugDeclarationId + "_" + expDrugPrimaryRemark.Id] = new SelectList(remarkTypes, "Id", "NameRu", expDrugPrimaryRemark.RemarkTypeId); } model.ExpDrugCorespondences = new DrugDeclarationRepository().GetDrugCorespondences(expertiseStage.DeclarationId); return(PartialView(model)); }
public override ActionResult AppDosage(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var model = new AppDosageRepository().GetStageByAppDosageId(id.Value); if (model == null) { return(HttpNotFound()); } FillDosageControl(model); model.EXP_DrugDosage.EXP_DrugDeclaration.ExpDicPrimaryOtds = new ReadOnlyDictionaryRepository().GetExpDicPrimaryOTDs().Where(e => e.ParentId == null).ToList(); model.ExpertisePharmacologicalFinalDoc = model.EXP_ExpertisePharmacologicalFinalDoc.FirstOrDefault(); if (model.ExpertisePharmacologicalFinalDoc == null) { model.ExpertisePharmacologicalFinalDoc = new EXP_ExpertisePharmacologicalFinalDoc(); model.ExpertisePharmacologicalFinalDoc.EXP_ExpertiseStageDosage = model; } var repository = new ReadOnlyDictionaryRepository(); ViewData["FinalyDocResultList" + model.EXP_DrugDosage.DrugDeclarationId] = new SelectList(repository.GetStageResultsByStage(model.EXP_ExpertiseStage.StageId), "Id", "NameRu", model.ResultId); var stageName = ExpStageNameHelper.GetName(GetStage()); ActionLogger.WriteInt(stageName + ": Получение заявки №" + model.EXP_DrugDosage.RegNumber); //todo во всех контроллерах так, позже можно замутить через наследование return(PartialView("~/Views/DrugDeclaration/AppDosage.cshtml", model)); }
public override ActionResult AppDosage(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var dosageRepository = new AppDosageRepository(); var model = dosageRepository.GetStageByAppDosageId(id.Value); if (model == null) { return(HttpNotFound()); } FillDosageControl(model); var safetyReportDosageStage = dosageRepository.GetStageDosage(model.DosageId, CodeConstManager.STAGE_SAFETYREPORT); model.ExpertiseSafetyreportFinalDoc = safetyReportDosageStage != null?safetyReportDosageStage.EXP_ExpertiseSafetyreportFinalDoc.FirstOrDefault() : null; model.EXP_DrugDosage.EXP_DrugDeclaration.ExpDicPrimaryOtds = new ReadOnlyDictionaryRepository().GetExpDicPrimaryOTDs().Where(e => e.ParentId == null).ToList(); var repository = new ReadOnlyDictionaryRepository(); ViewData["FinalyDocResultList" + model.EXP_DrugDosage.DrugDeclarationId] = new SelectList(repository.GetStageResultsByStage(model.EXP_ExpertiseStage.StageId), "Id", "NameRu", model.ResultId); var stageName = ExpStageNameHelper.GetName(GetStage()); ActionLogger.WriteInt(stageName + ": Получение заявки №" + model.EXP_DrugDosage.RegNumber); return(PartialView("~/Views/DrugDeclaration/AppDosage.cshtml", model)); }
public override ActionResult AppDosage(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var model = new AppDosageRepository().GetStageByAppDosageId(id.Value); if (model == null) { return(HttpNotFound()); } FillDosageControl(model); model.ExpDrugAnaliseIndicators = new List <EXP_DrugAnaliseIndicator>(); var list = model.EXP_DrugAnaliseIndicator.OrderBy(e => e.PositionNumber); var repository = new ReadOnlyDictionaryRepository(); var remarkTypes = repository.GetDicAnalyseIndicators().ToArray(); ViewData["AnalyseIndicatorList" + model.Id] = new SelectList(remarkTypes, "Id", "NameRu", null); var booleans = repository.GetBooleanList(); ViewData["Booleans" + model.Id] = new SelectList(booleans, "IsSign", "NameRu", null); foreach (var expDrugAnaliseIndicator in list) { // ViewData["AnalyseIndicatorList"+ expDrugAnaliseIndicator.Id] = new SelectList(remarkTypes, "Id", "NameRu", expDrugAnaliseIndicator.AnalyseIndicator); model.ExpDrugAnaliseIndicators.Add(expDrugAnaliseIndicator); } ViewData["FinalyDocResultList" + model.EXP_DrugDosage.DrugDeclarationId] = new SelectList(repository.GetStageResultsByStage(model.EXP_ExpertiseStage.StageId), "Id", "NameRu", model.ResultId); var stageName = ExpStageNameHelper.GetName(GetStage()); ActionLogger.WriteInt(stageName + ": Получение заявки №" + model.EXP_DrugDosage.RegNumber); return(PartialView("~/Views/DrugAnalitic/AppDosage.cshtml", model)); }
public override ActionResult AppDosage(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var model = new AppDosageRepository().GetStageByAppDosageId(id.Value); if (model == null) { return(HttpNotFound()); } FillDosageControl(model); var repositoryDic = new ReadOnlyDictionaryRepository(); var repository = new SafetyreportRepository(); model.EXP_DrugDosage.EXP_DrugDeclaration.ExpDicPrimaryOtds = repositoryDic.GetExpDicPrimaryOTDs().Where(e => e.ParentId == null).ToList(); model.ExpertiseSafetyreportFinalDoc = model.EXP_ExpertiseSafetyreportFinalDoc.FirstOrDefault(); if (model.ExpertiseSafetyreportFinalDoc == null) { model.ExpertiseSafetyreportFinalDoc = CreateExpertiseSafetyreportFinalDoc(model); repository.CreateExpertiseSafetyreportFinalDoc(model.ExpertiseSafetyreportFinalDoc); model.ExpertiseSafetyreportFinalDoc.EXP_ExpertiseStageDosage = model; } else { var newExpertiseSafetyreport = CreateExpertiseSafetyreportFinalDoc(model); if (string.IsNullOrEmpty(model.ExpertiseSafetyreportFinalDoc.Conclusion)) { model.ExpertiseSafetyreportFinalDoc.Conclusion = newExpertiseSafetyreport.Conclusion; } if (string.IsNullOrEmpty(model.ExpertiseSafetyreportFinalDoc.ConclusionKz)) { model.ExpertiseSafetyreportFinalDoc.ConclusionKz = newExpertiseSafetyreport.ConclusionKz; } repository.UpdateExpertiseSafetyreportFinalDoc(model.ExpertiseSafetyreportFinalDoc); } ViewData["FinalyDocResultList" + model.EXP_DrugDosage.DrugDeclarationId] = new SelectList(repositoryDic.GetStageResultsByStage(model.EXP_ExpertiseStage.StageId), "Id", "NameRu", model.ResultId); var stageName = ExpStageNameHelper.GetName(GetStage()); ActionLogger.WriteInt(stageName + ": Получение заявки №" + model.EXP_DrugDosage.RegNumber); return(PartialView("~/Views/DrugDeclaration/AppDosage.cshtml", model)); }