Пример #1
0
 public Request(t_aim entity) : this(entity, false)
 {
     ObjectType = RequestObjectType.Aim;
     ObjectId   = entity.aim_id;
     Name       = entity.get_name_translated(IidCulture.CurrentLanguageId);
     Status     = SetStatus(entity.active);
 }
Пример #2
0
 private JsonResult GetJsonResult(t_aim aim)
 {
     return(Json(new
     {
         success = true,
         ActivityId = aim.activity_id,
         AimId = aim.aim_id,
         Name = aim.get_name_translated(IidCulture.CurrentLanguageId),
         Active = aim.active,
         Status = aim.active.HasValue ? (aim.active.Value ? common.ActiveStatus : common.InactiveStatus) : common.PendingStatus
     }));
 }
Пример #3
0
        private void SetProperties(t_aim aim, bool loadChildren, bool translate)
        {
            ActivityId = aim.activity_id;
            AimId      = aim.aim_id;
            Active     = aim.active;
            Sort       = aim.sort;

            if (translate)
            {
                Name = aim.get_name_translated(CurrentLanguageId);
            }
            else
            {
                Name = aim.name;
            }

            if (loadChildren)
            {
                ActivityAims = UserAssignedObjects.GetAims(aim.activity.aims, CurrentUser).ToDictionary(e => e.aim_id, e => e.get_name_translated(CurrentLanguageId));
                Indicators   = UserAssignedObjects.GetIndicators(aim.indicators, CurrentUser).Select(i => new Indicator(i, false, true)).ToList();
            }
        }