コード例 #1
0
        public virtual ActionResult GetHistory(Guid modelId)
        {
            var repository = new SafetyAssessmentRepository();
            var result     = new List <OBK_DeclarationHistory>();
            var models     = repository.GetDeclarationHistory(modelId);

            foreach (var model in models)
            {
                if (repository.GetStageStatus(model.StageStatusId).Code == OBK_Ref_StageStatus.Completed &&
                    model.StatusId == 9)
                {
                    var history = new OBK_DeclarationHistory();
                    history.StartDateHistory = DateHelper.GetDate(model.StartDate);
                    history.EndDateHistory   = DateHelper.GetDate(model.EndDate);
                    history.Note             = model.Note;
                    history.StatusName       = repository.GetStatus(model.StatusId).NameRu;
                    history.StageName        = repository.GetStage(model.StageId).NameRu;
                    result.Add(history);
                }
            }
            return(Json(new { isSuccess = true, result }));
        }