コード例 #1
0
        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));
        }