Example #1
0
        public IActionResult Index()
        {
            MuscleViewModel muscleViewModel;
            var             musculeViewModels = new List <MuscleViewModel>();

            var muscles = _musclesService.FindMuscles();

            if (muscles != null)
            {
                foreach (var muscle in muscles)
                {
                    muscleViewModel = new MuscleViewModel()
                    {
                        Id                = muscle.Id,
                        Name              = muscle.Name,
                        MuscularGroupId   = muscle.MuscularGroupId,
                        MuscularGroupName = Translation.GetInDB(MuscularGroupTransformer.GetTranslationKey(muscle.MuscularGroupId))
                    };
                    musculeViewModels.Add(muscleViewModel);
                }
            }

            ViewBag.Muscles = musculeViewModels;

            return(View());
        }
 private void CompleteTranslation(MuscularGroup muscularGroup)
 {
     if (muscularGroup != null)
     {
         string trKey = MuscularGroupTransformer.GetTranslationKey(muscularGroup.Id);
         muscularGroup.Name = Translation.GetInDB(trKey, DbContext);
     }
 }
 private void SaveTranslation(MuscularGroup muscularGroup)
 {
     if (muscularGroup != null)
     {
         string trKey = MuscularGroupTransformer.GetTranslationKey(muscularGroup.Id);
         Translation.UpdateInDB(trKey, muscularGroup.Name, DbContext);
     }
 }
Example #4
0
        internal MuscularGroup GetMuscularGroup(MuscularGroupKey key)
        {
            var muscularGroup = _module.Get(key);

            if (muscularGroup != null)
            {
                muscularGroup.Name = Translation.GetInDB(MuscularGroupTransformer.GetTranslationKey(muscularGroup.Id));
            }
            return(muscularGroup);
        }
Example #5
0
        public List <MuscularGroup> FindMuscularGroups(MuscularGroupCriteria muscularGroupCriteria = null)
        {
            var muscularGroupList = _module.Find(muscularGroupCriteria);

            if (muscularGroupList != null)
            {
                foreach (var muscularGroup in muscularGroupList)
                {
                    if (muscularGroup != null)
                    {
                        muscularGroup.Name = Translation.GetInDB(MuscularGroupTransformer.GetTranslationKey(muscularGroup.Id));
                    }
                }
            }

            return(muscularGroupList);
        }
 internal void DeleteMuscularGroup(MuscularGroupKey key)
 {
     //Update Translation Name
     Translation.DeleteInDB(MuscularGroupTransformer.GetTranslationKey(key.Id), DbContext);
     _muscularGroupModule.Delete(key);
 }