예제 #1
0
        public virtual string GetDetailIndicator(int predefinedIndicatorId = 0)
        {
            var indicator = new CompletePredefinedIndicator
            {
                Disaggregations = new List <SimpleI18Resource>(),
                Sectors         = new List <PredefinedIndicatorSubType>(),
                Countries       = new List <PredefinedIndicatorSubType>(),
            };

            if (predefinedIndicatorId > 0)
            {
                indicator = this.PredefinedIndicatorModelRepository.GetDetailedIndicator(predefinedIndicatorId);
            }
            else
            {
                indicator.TechnicalFields = this.PredefinedIndicatorModelRepository.GetTechnicalFieldsMasterData();
            }

            indicator.PriorityAreas = this.PredefinedIndicatorModelRepository.GetPriorityAreasIndicator();

            IsoDateTimeConverter converter = new IsoDateTimeConverter()
            {
                DateTimeFormat = "MM/dd/yy", Culture = CultureInfo.InstalledUICulture
            };

            string isoJson = JsonConvert.SerializeObject(indicator, converter);

            return(isoJson);
        }
예제 #2
0
        public virtual JsonResult SavePredefinedIndicatorDetails(CompletePredefinedIndicator indicator)
        {
            if (!string.IsNullOrEmpty(indicator.TypeText))
            {
                indicator.TypeIndicator = indicator.TypeText;
            }

            var result = this.PredefinedIndicatorModelRepository.SavePredefinedIndicatorDetail(indicator);
            MessageConfiguration msg = new MessageConfiguration
            {
                Message   = result,
                Type      = "Error",
                Duration  = "100",
                AutoClose = "false"
            };

            ViewData["message"] = msg;

            return(Json(result));
        }