public Models.GroupLink GetAvailableGroup(string type, string leftText, string rightText)
        {
            var group = new Models.GroupLink
            {
                LeftText  = string.IsNullOrEmpty(leftText) ? "Group One" : leftText,
                RightText = string.IsNullOrEmpty(rightText) ? "Group Two" : rightText
            };

            var tagLists = ResolveUIEntityGroup(type);

            if (!tagLists.Any())
            {
                return(null);
            }

            if (tagLists.Keys.First().Count > 0)
            {
                group.LeftGroupTags = TagUILogic.ToModelTags(tagLists.Keys.ElementAt(0)).ToList();
            }
            if (tagLists.Values.First().Count > 0)
            {
                group.RightGroupTags = TagUILogic.ToModelTags(tagLists.Values.ElementAt(0)).ToList();
            }

            return(group);
        }
        //TODO: Move to UI App
        private void ResolveGroupLink(Models.GroupLink groupLink, string groupOne, string groupTwo, string creatorPrincipalId, string type)
        {
            switch (type)
            {
            case UITaggableEntity.User:
                _groupLinkBusinessLogic.AddToLinkEntities <User, Kiosk>(ToCommonGroupLink(groupLink), groupOne, groupTwo, creatorPrincipalId);
                break;

                //case UITaggableEntity.Application:
                //    _groupLinkBusinessLogic.AddToLinkEntities<Application, Kiosk>(ToCommonGroupLink(groupLink), groupOne, groupTwo, creatorPrincipalId);
                //    break;

                //case UITaggableEntity.ItemRegistration:
                //    _groupLinkBusinessLogic.AddToLinkEntities<ItemRegistration, Kiosk>(ToCommonGroupLink(groupLink), groupOne, groupTwo, creatorPrincipalId);

                //    break;

                //case UITaggableEntity.ContentPackage:
                //    _groupLinkBusinessLogic.AddToLinkEntities<ContentPackage, Kiosk>(ToCommonGroupLink(groupLink), groupOne, groupTwo, creatorPrincipalId);

                //    break;

                //case UITaggableEntity.SchedulePlan:
                //    _groupLinkBusinessLogic.AddToLinkEntities<SchedulePlan, Kiosk>(ToCommonGroupLink(groupLink), groupOne, groupTwo, creatorPrincipalId);

                //    break;

                //case UITaggableEntity.Device:
                //    _groupLinkBusinessLogic.AddToLinkEntities<Kiosk, SchedulePlan>(ToCommonGroupLink(groupLink), groupOne, groupTwo, creatorPrincipalId);

                //    break;
            }
        }
 public static Lok.Unik.ModelCommon.Client.GroupLink ToCommonGroupLink(Models.GroupLink groupLink)
 {
     return(new Lok.Unik.ModelCommon.Client.GroupLink
     {
         Id = groupLink.Id,
         Name = groupLink.Name,
         GroupOne = groupLink.GroupOne,
         GroupTwo = groupLink.GroupTwo,
         CreatorPrincipalId = groupLink.CreatorPrincipalId,
         CreateDate = groupLink.CreateDate
     });
 }
 public bool ExistGroups(Models.GroupLink group)
 {
     return(group.LeftGroupTags != null && group.RightGroupTags != null);
 }
 public void AddToLinkEntities(Models.GroupLink groupLink, string groupOne, string groupTwo, string creatorPrincipalId, string type)
 {
     ResolveGroupLink(groupLink, groupOne, groupTwo, creatorPrincipalId, type);
 }