示例#1
0
        public static PlanshetViewData SetTabData(
            string uniqueId,
            string headTranslateName,
            List <string> translateTabNames,
            List <IPlanshetBodyTemplate> templateData,
            string rootTemplate,
            IReadOnlyList <string> tabBodyIds)
        {
            var tabs = new PlanshetViewData
            {
                TabTemplateUrl    = "planshet-tabs.tmpl",
                TemplateUrl       = rootTemplate,
                HeadTranslateName = headTranslateName,
                Bodys             = templateData,
                UniqueId          = uniqueId.ToLower(),
                HasTabs           = true
            };
            var buttons = new List <IButtonsView>();

            for (byte i = 0; i < 3; i++)
            {
                buttons.Add(ButtonsView.TabBtn(i, translateTabNames[i]));

                tabs.Bodys[i].BodyId = tabBodyIds[i];
            }
            tabs.Buttons = buttons;

            return(tabs);
        }
示例#2
0
        public static IButtonsView SmallDefault(string name, bool showName = false, string buttonId = null, string method = null, object param = null)
        {
            var btn = new ButtonsView
            {
                TranslateName = name,
                CssClass      = CssSmall,
                ShowName      = showName
            };

            if (method != null)
            {
                btn.Method = method;
            }
            if (param != null)
            {
                btn.Params = param;
            }
            if (!string.IsNullOrWhiteSpace(buttonId))
            {
                btn.ButtonId = buttonId;
            }

            return(btn);
        }