Exemplo n.º 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());
        }
Exemplo n.º 2
0
 private void CompleteTranslation(MuscularGroup muscularGroup)
 {
     if (muscularGroup != null)
     {
         string trKey = MuscularGroupTransformer.GetTranslationKey(muscularGroup.Id);
         muscularGroup.Name = Translation.GetInDB(trKey, DbContext);
     }
 }
Exemplo n.º 3
0
 private void SaveTranslation(MuscularGroup muscularGroup)
 {
     if (muscularGroup != null)
     {
         string trKey = MuscularGroupTransformer.GetTranslationKey(muscularGroup.Id);
         Translation.UpdateInDB(trKey, muscularGroup.Name, DbContext);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
 internal void DeleteMuscularGroup(MuscularGroupKey key)
 {
     //Update Translation Name
     Translation.DeleteInDB(MuscularGroupTransformer.GetTranslationKey(key.Id), DbContext);
     _muscularGroupModule.Delete(key);
 }