Exemple #1
0
        public ActionResult Record(int indicatorId, int siteId, DateTime?beginDate)
        {
            using (Entity context = new Entity())
            {
                t_indicator indicator = context.t_indicator.Find(indicatorId);
                if (indicator == null)
                {
                    throw new ArgumentException("Invalid indicatorId: " + indicatorId.ToString());
                }

                t_activity activity = indicator.aim.activity;

                t_activity_site activitySite = activity.sites.Where(e => e.site_id == siteId).First();

                if (activitySite == null)
                {
                    throw new ArgumentException(String.Format("Site {0} is not attached to Indicator {1} (Activity {2}).", siteId, indicatorId, activity.activity_id));
                }

                Observation model = new Observation(indicator, activitySite.site, beginDate);

                AccessPass = SecurityGuard(CurrentUser, activity.country_id, activity.activity_id, siteId);
                if (AccessPass == BusinessLayer.Identity.UserSecurityAccess.NoAccess)
                {
                    return(RedirectToAction("NoAccess", "Home"));
                }
                ViewBag.AccessRights = AccessPass;

                return(View(model));
            }
        }
Exemple #2
0
        public ActionResult RecordByAttachment(int id)
        {
            using (Entity context = new Entity())
            {
                t_observation_attachment attachment = context.t_observation_attachment.Find(id);
                if (attachment == null)
                {
                    throw new ArgumentException("Invalid ObservationAttachmentID: " + id.ToString());
                }

                t_observation observation = context.t_observation.Find(attachment.observation_id);
                if (observation == null)
                {
                    throw new ArgumentException("Invalid observationId: " + attachment.observation_id.ToString());
                }

                t_site site = context.t_site.Find(observation.site_id);
                if (site == null)
                {
                    throw new ArgumentException("Invalid siteId: " + observation.site_id.ToString());
                }

                t_indicator indicator = context.t_indicator.Find(observation.indicator_id);
                if (indicator == null)
                {
                    throw new ArgumentException("Invalid indicatorId: " + observation.indicator_id.ToString());
                }

                return(View("Record", (new Observation(indicator, site, observation.begin_date))));

                //RedirectToAction("Record", (new Observation(observation.site_id, site, observation.begin_date)));
                //return RedirectToAction("Record", new { indicatorId = observation.indicator_id, siteId = observation.site_id, beginDate = observation.begin_date });
                //return Record(observation.indicator_id, observation.site_id, observation.begin_date);
            }
        }
Exemple #3
0
 public Request(t_indicator entity) : this(entity, false)
 {
     ObjectType = RequestObjectType.Indicator;
     ObjectId   = entity.indicator_id;
     Name       = entity.get_name_translated(IidCulture.CurrentLanguageId);
     Status     = SetStatus(entity.active);
 }
Exemple #4
0
 private JsonResult GetSortResult(t_indicator indicator1, t_indicator indicator2)
 {
     return(Json(new
     {
         Indicator1 = new { Id = indicator1.indicator_id, Sort = indicator1.sort },
         Indicator2 = new { Id = indicator2?.indicator_id, Sort = indicator2?.sort }
     }));
 }
Exemple #5
0
        private void SetIndicator(int indicatorId)
        {
            t_indicator indicator = Context.t_indicator.Find(indicatorId);

            Indicators          = UserAssignedObjects.GetIndicators(indicator.aim.activity.aims.SelectMany(a => a.indicators), CurrentUser).Select(i => new Indicator(i, false, true, true)).ToList();
            SelectedIndicatorId = indicatorId;

            SetActivity(indicator.aim.activity);
            // TODO: Recurse to project, organization?
        }
Exemple #6
0
        public ActionResult View(int indicatorId, int siteId)
        {
            using (Entity context = new Entity())
            {
                t_indicator indicator = context.t_indicator.Find(indicatorId);
                if (indicator == null)
                {
                    throw new ArgumentException("Invalid indicatorId: " + indicatorId.ToString());
                }

                t_activity      activity = indicator.aim.activity;
                t_activity_site site     = activity.sites.Where(e => e.site_id == siteId).First();
                if (site == null)
                {
                    throw new ArgumentException(String.Format("Site {0} is not attached to Indicator {1} (Activity {2}).", siteId, indicatorId, activity.activity_id));
                }

                byte languageId = IidCulture.CurrentLanguageId;

                IndicatorSiteObservations model = new IndicatorSiteObservations()
                {
                    ActivityId           = activity.activity_id,
                    ActivityName         = activity.get_name_translated(languageId),
                    IndicatorId          = indicatorId,
                    IndicatorType        = Enumerations.Parse <IndicatorType>(indicator.indicator_type.value),
                    IndicatorTypeFieldId = indicator.indicator_type_fieldid,
                    SiteId                = siteId,
                    IndicatorName         = indicator.get_name_translated(languageId),
                    IndicatorDefinition   = indicator.get_definition_translated(languageId),
                    NumeratorName         = indicator.get_numerator_name_translated(languageId),
                    NumeratorDefinition   = indicator.get_numerator_definition_translated(languageId),
                    DenominatorName       = indicator.get_denominator_name_translated(languageId),
                    DenominatorDefinition = indicator.get_denominator_definition_translated(languageId),
                    DisaggregateByAge     = indicator.disaggregate_by_age,
                    DisaggregateBySex     = indicator.disaggregate_by_sex
                };

                AccessPass = SecurityGuard(CurrentUser, activity.country_id, activity.activity_id, siteId);
                if (AccessPass == BusinessLayer.Identity.UserSecurityAccess.NoAccess)
                {
                    return(RedirectToAction("NoAccess", "Home"));
                }
                ViewBag.AccessRights = AccessPass;

                return(View(model));
            }
        }
Exemple #7
0
        public Observation(t_indicator indicator, t_site site, DateTime?beginDate)
        {
            t_observation observation =
                indicator.observations.Where(e => e.begin_date == beginDate && e.site_id == site.site_id).FirstOrDefault();

            if (observation == null)
            {
                if (beginDate.HasValue)
                {
                    BeginDate = beginDate.Value;
                    ObjectParameter endDate = new ObjectParameter("end_date", typeof(DateTime));
                    Context.p_get_period_end_date(beginDate, indicator.data_collection_frequency_fieldid, endDate);
                    EndDate = (DateTime)endDate.Value;
                }
                else
                {
                    DateTime lastDay = beginDate ?? indicator.aim.activity.end_date ?? DateTime.Now;
                    p_get_latest_date_period_Result result =
                        Context.p_get_latest_date_period(lastDay, indicator.data_collection_frequency_fieldid).FirstOrDefault();
                    BeginDate = result.begin_date.Value;
                    EndDate   = result.end_date.Value;
                }

                IsAgeDisaggregated = indicator.disaggregate_by_age;
                IsSexDisaggregated = indicator.disaggregate_by_sex;
            }
            else
            {
                ObservationId      = observation.observation_id;
                BeginDate          = observation.begin_date;
                EndDate            = observation.end_date;
                IsAgeDisaggregated = observation.is_age_disaggregated;
                IsSexDisaggregated = observation.is_sex_disaggregated;
            }

            SetProperties(indicator.indicator_id, site.site_id, observation, true);
        }
Exemple #8
0
        public CoachReportIndicator(int siteId, t_indicator indicator)
        {
            byte languageId = IidCulture.CurrentLanguageId;

            SiteId                    = siteId;
            AimId                     = indicator.aim_id;
            AimName                   = indicator.aim.name;
            IndicatorId               = indicator.indicator_id;
            IndicatorName             = indicator.name;
            IndicatorDefinition       = indicator.definition;
            IndicatorType             = Enumerations.Parse <IndicatorType>(indicator.indicator_type.value);
            DataCollectionFrequencyId = indicator.data_collection_frequency_fieldid;
            Observations              = new List <CoachReportObservation>();


            if (IndicatorType == IndicatorType.Ratio)
            {
                RatioValue = indicator.rate_per.value;
            }

            var observations = indicator.observations.Where(e => e.site_id == siteId).OrderBy(e => e.begin_date);

            foreach (var observation in observations)
            {
                foreach (var entry in observation.entries.Where(e => e.indicator_age_range_id == null && e.indicator_gender == null))
                {
                    if (Enumerations.Parse <DataCollectionFrequency>(indicator.data_collection_frequency.value) == DataCollectionFrequency.Daily)
                    {
                        //observation.begin_date = Date.StartOfWeek(observation.begin_date);

                        int diff = (7 + (observation.begin_date.DayOfWeek - DayOfWeek.Sunday)) % 7;
                        observation.begin_date = observation.begin_date.AddDays(-1 * diff).Date;
                    }

                    var o = new CoachReportObservation(observation.begin_date, entry.indicator_numeric_value);

                    var changes =
                        observation.changes
                        .Where(e => e.approved)
                        .OrderBy(e => e.start_date)
                        .ThenBy(e => e.observation_change_id);
                    if (changes != null && changes.Any())
                    {
                        o.FirstChangeId      = changes.First().observation_change_id;
                        o.ChangeDescriptions = String.Join("<br />", changes.Select(e => e.description));
                    }

                    Observations.Add(o);
                }
            }

            if (Enumerations.Parse <DataCollectionFrequency>(indicator.data_collection_frequency.value) == DataCollectionFrequency.Daily)
            {
                List <CoachReportObservation> ObservationsGrouped;
                ObservationsGrouped = new List <CoachReportObservation>();
                ObservationsGrouped = Observations.GroupBy(e => e.Date).Select(n => new CoachReportObservation(n.Key, null)
                {
                    Date               = n.Key,
                    Value              = n.Average(v => v.Value),
                    FirstChangeId      = n.Min(f => f.FirstChangeId),
                    ChangeDescriptions = n.Min(c => c.ChangeDescriptions)
                }).ToList();

                Observations = ObservationsGrouped;
            }

            if (Observations.Any() && Observations.Count > 1)
            {
                // Fill in gaps. Wish we would have done this via stored proc instead of EF...
                DateTime firstDate = Observations.Min(o => o.Date);
                DateTime lastDate  = Observations.Max(o => o.Date);
                Func <DateTime, DateTime> addInterval = null;
                switch (Enumerations.Parse <DataCollectionFrequency>(indicator.data_collection_frequency.value))
                {
                case DataCollectionFrequency.Daily:
                    //addInterval = new Func<DateTime, DateTime>(x => x.AddDays(1));
                    addInterval = new Func <DateTime, DateTime>(x => x.AddDays(7));
                    break;

                case DataCollectionFrequency.Weekly:
                    addInterval = new Func <DateTime, DateTime>(x => x.AddDays(7));
                    break;

                case DataCollectionFrequency.BiWeekly:
                    addInterval = new Func <DateTime, DateTime>(x => x.AddDays(14));
                    break;

                case DataCollectionFrequency.Monthly:
                    addInterval = new Func <DateTime, DateTime>(x => x.AddMonths(1));
                    break;

                case DataCollectionFrequency.Quarterly:
                    addInterval = new Func <DateTime, DateTime>(x => x.AddMonths(3));
                    break;
                }
                var theDate = addInterval(firstDate);
                do
                {
                    // Daily gets summed as weekly
                    //if (Enumerations.Parse<DataCollectionFrequency>(indicator.data_collection_frequency.value)== DataCollectionFrequency.Daily)
                    //{
                    //    if (!Observations.Any(o => o.Date == theDate))
                    //        Observations.Add(new CoachReportObservation(theDate, null));
                    //    theDate = addInterval(theDate);

                    //}
                    //else
                    if (!Observations.Any(o => o.Date == theDate))
                    {
                        Observations.Add(new CoachReportObservation(theDate, null));
                    }
                    theDate = addInterval(theDate);
                }while (theDate < lastDate);

                // Re-order by date.
                Observations = Observations.OrderBy(o => o.Date).ToList();
            }
        }
Exemple #9
0
        private t_indicator SetEntityFromModel(Indicator model)
        {
            using (Entity context = new Entity())
            {
                t_indicator indicator = null;
                if (model.IndicatorId.HasValue)
                {
                    indicator = context.t_indicator.Find(model.IndicatorId.Value);
                    if (indicator == null)
                    {
                        throw new ArgumentException("Invalid indicatorId: " + model.IndicatorId.ToString());
                    }
                    indicator.updatedby_userid = CurrentUser.Id;
                    indicator.updated_date     = DateTime.Now;
                }
                else
                {
                    indicator = new t_indicator();
                    indicator.createdby_userid = CurrentUser.Id;
                    indicator.created_date     = DateTime.Now;

                    byte maxSort = 0;
                    var  aim     = context.t_aim.Find(model.AimId);
                    if (aim.indicators.Count > 0)
                    {
                        maxSort = aim.indicators.Max(e => e.sort);
                    }
                    indicator.sort = maxSort += 1;

                    context.t_indicator.Add(indicator);
                }

                var language = IidCulture.CurrentLanguage;

                indicator.aim_id = model.AimId;

                // Only apply t_indicator.name if the language is English or this is
                // a new indicator (in which case, we have to supply some value).
                if (language == Language.English || !model.IndicatorId.HasValue)
                {
                    indicator.name       = model.Name;
                    indicator.definition = model.Definition;
                }

                t_fieldid     indicatorTypeField = context.t_fieldid.Find(model.TypeFieldId);
                IndicatorType indicatorType      = Enumerations.Parse <IndicatorType>(indicatorTypeField.value);
                switch (indicatorType)
                {
                case IndicatorType.Percentage:
                case IndicatorType.Average:
                case IndicatorType.Ratio:
                    if (language == Language.English || !model.IndicatorId.HasValue)
                    {
                        indicator.numerator_name         = model.NumeratorName;
                        indicator.numerator_definition   = model.NumeratorDefinition;
                        indicator.numerator_source       = model.NumeratorSource;
                        indicator.denominator_name       = model.DenominatorName;
                        indicator.denominator_definition = model.DenominatorDefinition;
                        indicator.denominator_source     = model.DenominatorSource;
                    }
                    break;

                default:
                    indicator.numerator_name         = null;
                    indicator.numerator_definition   = null;
                    indicator.denominator_name       = null;
                    indicator.denominator_definition = null;
                    indicator.denominator_source     = null;
                    break;
                }
                indicator.numerator_source                  = model.NumeratorSource;
                indicator.indicator_type_fieldid            = model.TypeFieldId;
                indicator.group_fieldid                     = model.GroupFieldId;
                indicator.data_collection_frequency_fieldid = model.DataCollectionFrequencyFieldId;
                indicator.sampling_fieldid                  = model.SamplingFieldId;
                indicator.report_class_fieldid              = model.ReportClassFieldId;
                switch (indicatorType)
                {
                case IndicatorType.Percentage:
                case IndicatorType.Average:
                case IndicatorType.Count:
                case IndicatorType.Ratio:
                    indicator.change_variable = model.ChangeVariable;
                    break;

                default:
                    indicator.change_variable = null;
                    break;
                }
                switch (indicatorType)
                {
                case IndicatorType.Percentage:
                case IndicatorType.Average:
                case IndicatorType.Count:
                case IndicatorType.Ratio:
                    indicator.disaggregate_by_sex = model.DisaggregateBySex;
                    indicator.disaggregate_by_age = model.DisaggregateByAge;
                    break;

                default:
                    indicator.disaggregate_by_sex = false;
                    indicator.disaggregate_by_age = false;
                    break;
                }
                switch (indicatorType)
                {
                case IndicatorType.Percentage:
                case IndicatorType.Average:
                case IndicatorType.Count:
                case IndicatorType.Ratio:
                    indicator.target_performance         = model.TargetPerformance;
                    indicator.threshold_good_performance = model.ThresholdGoodPerformance;
                    indicator.threshold_poor_performance = model.ThresholdPoorPerformance;
                    indicator.increase_is_good           = model.IncreaseIsGood;
                    break;

                default:
                    indicator.target_performance         = null;
                    indicator.threshold_good_performance = null;
                    indicator.threshold_poor_performance = null;
                    indicator.increase_is_good           = false;
                    break;
                }
                switch (indicatorType)
                {
                case IndicatorType.Ratio:
                    indicator.rate_per_fieldid = model.RatePerFieldId;
                    break;

                default:
                    indicator.rate_per_fieldid = null;
                    break;
                }
                indicator.active = model.Active;


                context.SaveChanges();

                // Defer translation logic until after the indicator has been saved to the db.
                // This is necessary because we depend on indicator_id, which may not be known sooner.
                if (language != Language.English)
                {
                    var languageId = IidCulture.CurrentLanguageId;
                    var userId     = CurrentUser.Id;
                    indicator.set_name_translated(languageId, model.Name, userId);
                    indicator.set_definition_translated(languageId, model.Definition, userId);
                    indicator.set_numerator_name_translated(languageId, model.NumeratorName, userId);
                    indicator.set_numerator_definition_translated(languageId, model.NumeratorDefinition, userId);
                    indicator.set_numerator_source_translated(languageId, model.NumeratorSource, userId);
                    indicator.set_denominator_name_translated(languageId, model.DenominatorName, userId);
                    indicator.set_denominator_definition_translated(languageId, model.DenominatorDefinition, userId);
                    indicator.set_denominator_source_translated(languageId, model.DenominatorSource, userId);
                }

                // NOTE: Once observations have been recorded, age ranges cannot be modified,
                // as this would cause a primary key constraint violation.
                if (indicator.observations?.Count() == 0)
                {
                    context.t_indicator_age_range.RemoveRange(indicator.indicator_age_ranges);
                    if (model.DisaggregateByAge && model.AgeRangeNames != null)
                    {
                        foreach (string ageRange in model.AgeRangeNames)
                        {
                            indicator.indicator_age_ranges.Add(
                                new t_indicator_age_range()
                            {
                                indicator_id = indicator.indicator_id,     //entity.IndicatorId.Value,
                                age_range    = ageRange
                            });
                        }

                        context.SaveChanges();
                    }
                }

                return(indicator);
            }
        }
Exemple #10
0
        public ActionResult Add(Indicator model)
        {
            t_indicator entity = SetEntityFromModel(model);

            return(RedirectToAction("View", new { id = entity.indicator_id }));
        }
Exemple #11
0
        public CountryDirectorReportIndicator(int countryId, t_indicator indicator)
        {
            byte languageId = IidCulture.CurrentLanguageId;

            //SiteId = siteId;
            AimId                     = indicator.aim_id;
            AimName                   = indicator.aim.name;
            ActivityName              = indicator.aim.activity.name;
            CountryName               = indicator.aim.activity.country.name;
            IndicatorId               = indicator.indicator_id;
            IndicatorName             = indicator.name;
            IndicatorDefinition       = indicator.definition;
            IndicatorType             = Enumerations.Parse <IndicatorType>(indicator.indicator_type.value);
            DataCollectionFrequencyId = indicator.data_collection_frequency_fieldid;
            Observations              = new List <CountryDirectorReportObservation>();

            if (IndicatorType == IndicatorType.Ratio)
            {
                RatioValue = indicator.rate_per.value;
            }

            //var results = (from i in indicator.observations
            //               select new CountryDirectorReportObservation()
            //               {
            //                   Date = i.begin_date,
            //                   Value = i.entries.Average(k => k.indicator_numeric_value)

            //               })
            //              .OrderBy(o => o.Date)
            //              .ToList();

            //if (Enumerations.Parse<DataCollectionFrequency>(indicator.data_collection_frequency.value) == DataCollectionFrequency.Daily)
            //{
            //    foreach (CountryDirectorReportObservation o in results)
            //    {
            //        int diff = (7 + (o.Date.DayOfWeek - DayOfWeek.Sunday)) % 7;
            //        o.Date = o.Date.AddDays(-1 * diff).Date;
            //    }
            //}

            //Observations = results.GroupBy(item => item.Date)
            //        .Select(g => new CountryDirectorReportObservation()
            //        {
            //            Date = g.Key,
            //            Value = g.Average(s => s.Value)
            //        })
            //        .OrderBy(o => o.Date)
            //        .ToList();

            using (Entity context = new Entity())
            {
                //CountryStats = new List<CountryDashboardDetails>();

                context.Database.Initialize(false);

                var cmd = context.Database.Connection.CreateCommand();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "dbo.p_get_country_director_report";
                cmd.Parameters.Add(new SqlParameter("@user_id", 0));
                cmd.Parameters.Add(new SqlParameter("@indicator_id", IndicatorId));

                try
                {
                    context.Database.Connection.Open();
                    var reader = cmd.ExecuteReader();
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            CountryDirectorReportObservation item = new CountryDirectorReportObservation();
                            var test = reader[1].ToString();
                            item.Date = (DateTime)reader[0];
                            if (reader[1] != DBNull.Value)
                            {
                                item.Value = (Double)reader.GetDecimal(1);
                            }
                            Observations.Add(item);
                        }
                    }
                }

                finally
                {
                    context.Database.Connection.Close();
                }
            }
        }
Exemple #12
0
        private void SetProperties(t_indicator entity, bool loadChildren, bool loadParent, bool translate)
        {
            ActivityId   = entity.aim?.activity_id ?? -1; // Refactor as nullable int when possible.
            AimId        = entity.aim_id;
            IndicatorId  = entity.indicator_id;
            TypeFieldId  = entity.indicator_type_fieldid;
            TypeValue    = entity.indicator_type?.value;
            GroupFieldId = entity.group_fieldid;
            GroupValue   = entity.indicator_group?.value;
            DataCollectionFrequencyFieldId = entity.data_collection_frequency_fieldid;
            DataCollectionFrequencyValue   = entity.data_collection_frequency?.value;
            SamplingFieldId    = entity.sampling_fieldid;
            ReportClassFieldId = entity.report_class_fieldid;
            ReportClassValue   = entity.report_class?.value;
            SamplingValue      = entity.sampling?.value;
            ChangeVariable     = entity.change_variable;
            DisaggregateBySex  = entity.disaggregate_by_sex;
            DisaggregateByAge  = entity.disaggregate_by_age;
            if (DisaggregateByAge)
            {
                AgeRanges =
                    entity.indicator_age_ranges
                    .OrderBy(e => e.indicator_age_range_id)
                    .ToDictionary(e => Convert.ToString(e.indicator_age_range_id), e => e.age_range);
            }
            else
            {
                AgeRanges = new Dictionary <string, string>();
            }
            TargetPerformance        = entity.target_performance;
            ThresholdGoodPerformance = entity.threshold_good_performance;
            ThresholdPoorPerformance = entity.threshold_poor_performance;
            IncreaseIsGood           = entity.increase_is_good;
            RatePerFieldId           = entity.rate_per_fieldid;
            RatePerValue             = entity.rate_per?.value;
            Active = entity.active;
            Sort   = entity.sort;

            if (translate)
            {
                Definition            = entity.get_definition_translated(CurrentLanguageId);
                Name                  = entity.get_name_translated(CurrentLanguageId);
                NumeratorName         = entity.get_numerator_name_translated(CurrentLanguageId);
                NumeratorDefinition   = entity.get_numerator_definition_translated(CurrentLanguageId);
                NumeratorSource       = entity.get_numerator_source_translated(CurrentLanguageId);
                DenominatorName       = entity.get_denominator_name_translated(CurrentLanguageId);
                DenominatorDefinition = entity.get_denominator_definition_translated(CurrentLanguageId);
                DenominatorSource     = entity.get_denominator_source_translated(CurrentLanguageId);
                //

                DataCollectionFrequencyValue = entity.get_data_frequency_translated(CurrentLanguageId, DataCollectionFrequencyValue);
            }
            else
            {
                Definition            = entity.definition;
                Name                  = entity.name;
                NumeratorName         = entity.numerator_name;
                NumeratorDefinition   = entity.numerator_definition;
                NumeratorSource       = entity.numerator_source;
                DenominatorName       = entity.denominator_name;
                DenominatorDefinition = entity.denominator_definition;
                DenominatorSource     = entity.denominator_source;
            }

            if (loadParent)
            {
                Aim = new Aim(AimId, false);
            }

            if (loadChildren)
            {
                ActivityAims =
                    UserAssignedObjects.GetAims(entity.aim.activity.aims, CurrentUser)
                    .Select(e => new Tuple <int?, string>(e.aim_id, e.get_name_translated(CurrentLanguageId)))
                    .ToList();
                Sites =
                    entity.aim.activity.sites
                    .Select(e => new ActivitySite(e))
                    .ToList();
                HasObservations = entity.observations?.Any() ?? false;
                OtherIndicators =
                    UserAssignedObjects.GetIndicators(entity.aim.indicators, CurrentUser)
                    .Where(e => e.indicator_id != IndicatorId)
                    .Select(e => new Indicator(e, false, true))
                    .ToList();
            }
        }
Exemple #13
0
 public Indicator(t_indicator entity, bool loadChildren, bool loadParent, bool translate)
 {
     SetProperties(entity, loadChildren, loadParent, translate);
 }
Exemple #14
0
        public Indicator(int indicatorId, bool loadChildren)
        {
            t_indicator entity = Context.t_indicator.Find(indicatorId);

            SetProperties(entity, loadChildren, loadChildren, true);
        }