private async void InitializeApp() { var _appProfile = await AppProfile.Load(); AppDIContainer.Instance.InitializeWithAppProfile(_appProfile); AppDIContainer.Instance.Resolve <IDbInitializer>().Execute(); // TODO Async view display before profile is loaded MainPage = new NavigationTab(); }
public static void FillNavPane(ref NavigationTabs navTabs) { XmlDocument oXmlDoc = NavDocument; if (oXmlDoc != null) { navTabs.TabPages.Clear(); XmlNodeList oNodeList = oXmlDoc.DocumentElement.ChildNodes; foreach (XmlNode oNode in oNodeList) { XmlNode oCurNode = oNode; if (oCurNode.HasChildNodes) { var tabPage = new NavigationTab(); var caption = oCurNode.Attributes["Caption"].Value; tabPage.Image = new IconResourceHandle(oCurNode.Attributes["ImageUrl"].Value); tabPage.Location = new System.Drawing.Point(4, 22); tabPage.Name = "tab" + oCurNode.Attributes["Caption"].Value; tabPage.Size = new System.Drawing.Size(142, 316); tabPage.TabIndex = 0; tabPage.Text = WestwindHelper.GetWord(caption.ToLower(), "Menu"); tabPage.Tag = oCurNode.Attributes["Caption"].Value; navTabs.Controls.Add(tabPage); switch (oCurNode.Name.ToLower()) { case "inventory": RT2020.NavPane.InventoryNav navInvt = new RT2020.NavPane.InventoryNav(); navInvt.Dock = DockStyle.Fill; tabPage.Controls.Add(navInvt); break; case "purchasing": RT2020.NavPane.PurchasingNav navPurchasing = new RT2020.NavPane.PurchasingNav(); navPurchasing.Dock = DockStyle.Fill; tabPage.Controls.Add(navPurchasing); break; case "shop": RT2020.NavPane.ShopNav navShop = new RT2020.NavPane.ShopNav(); navShop.Dock = DockStyle.Fill; tabPage.Controls.Add(navShop); break; case "membermgmt": RT2020.NavPane.MemberMgmtNav navMemberMgmt = new RT2020.NavPane.MemberMgmtNav(); navMemberMgmt.Dock = DockStyle.Fill; tabPage.Controls.Add(navMemberMgmt); break; case "settings": RT2020.NavPane.SettingsNav navSettings = new RT2020.NavPane.SettingsNav(); navSettings.Dock = DockStyle.Fill; tabPage.Controls.Add(navSettings); break; case "product": RT2020.NavPane.ProductNav navProduct = new RT2020.NavPane.ProductNav(); navProduct.Dock = DockStyle.Fill; tabPage.Controls.Add(navProduct); break; } } } } }
public static IHtmlString CreateNavigationTab(this HtmlHelper html, NavigationTab navigationTab) { //parent var container = new TagBuilder("div"); container.AddCssClass("cell"); container.AddCssClass("tab"); container.AddCssClass(navigationTab.HighlightState); if (navigationTab.Type == NagivationTabType.YourOrder) { //container.AddCssClass("right"); } var tabdiv = new TagBuilder("div"); tabdiv.AddCssClass("frame"); tabdiv.AddCssClass(navigationTab.CssClass); var title = new TagBuilder("span"); title.AddCssClass("title"); title.SetInnerText(navigationTab.Title); var help = new TagBuilder("img"); help.AddCssClass("hand"); help.Attributes.Add("src", "/Content/images/jeweldesign/tabs/question.png"); help.Attributes.Add("tooltip", navigationTab.ToolTipBody); help.Attributes.Add("tooltip-title", navigationTab.ToolTipTitle); title.InnerHtml += help.ToString(TagRenderMode.Normal); tabdiv.InnerHtml = title.ToString(TagRenderMode.Normal); if (navigationTab.HasEditAndViewLinks) { var modify = new TagBuilder("a"); modify.SetInnerText("Modify"); modify.MergeAttribute("href", navigationTab.ModifyRoute); tabdiv.InnerHtml += modify.ToString(TagRenderMode.Normal); var view = new TagBuilder("a"); view.SetInnerText("View"); view.MergeAttribute("href", navigationTab.ViewRoute); tabdiv.InnerHtml += view.ToString(TagRenderMode.Normal); } if (!String.IsNullOrWhiteSpace(navigationTab.Amount)) { var amount = new TagBuilder("span"); amount.AddCssClass("amount"); amount.AddCssClass("inline"); amount.AddCssClass("right"); amount.SetInnerText(navigationTab.Amount); tabdiv.InnerHtml += amount.ToString(TagRenderMode.Normal); } container.InnerHtml += tabdiv.ToString(TagRenderMode.Normal); return(MvcHtmlString.Create(container.ToString(TagRenderMode.Normal))); }
public static void Build() { try { var session = Session.DatabaseConnection; List <string> Permissionlist = new List <string>(); Models.Core.User user = Session.CurrentUser; string nodename = null; Session.MainForm.navigationMenu.Controls.Clear(); System.Drawing.Font nodeFont = new System.Drawing.Font("Tahoma", 10); System.Drawing.Font topNodeFont = new System.Drawing.Font("Tahoma", 10, System.Drawing.FontStyle.Bold); ImageList tabImages = new ImageList(); Session.MainForm.navigationMenu.ImageList = tabImages; int imageIdx = 0; if (user.UserGroup != null) { IList <Models.Core.UserGroupMenu> userGroupMenus = session.CreateCriteria(typeof(Models.Core.UserGroupMenu)) .Add(Expression.Eq("UserGroup", user.UserGroup)) .AddOrder(Order.Asc("Sequence")) .List <Models.Core.UserGroupMenu>(); foreach (Models.Core.UserGroupMenu ugmMenu in userGroupMenus) { TreeView menuTree = new TreeView(); menuTree.SelectedNode = null; menuTree.SelectOnRightClick = true; menuTree.Nodes.Clear(); Models.Core.Menu menu = ugmMenu.Menu; IList <Models.Core.MenuItem> menuPrograms = session.CreateCriteria(typeof(Models.Core.MenuItem)) .Add(Expression.Eq("Menu", menu)) .AddOrder(Order.Asc("Sequence")) .List <Models.Core.MenuItem>(); foreach (Models.Core.MenuItem menuProgram in menuPrograms) { Models.Core.Program program = menuProgram.Program; nodename = Localization.TranslateCpt(program.Form, "_form", Session.CurrentUser.Language ?? "en", program.Description); menuTree.Nodes.Add(program.Code, nodename).NodeFont = nodeFont; Permissionlist.Add(program.Code.ToLower()); } NavigationTab objTabControls = new NavigationTab(menu.Description); menuTree.Dock = DockStyle.Fill; menuTree.ShowLines = false; menuTree.NodeMouseClick += Session.MainForm.menuTree_MouseClick; objTabControls.Controls.Add(menuTree); if (!string.IsNullOrEmpty(menu.Icon)) { tabImages.Images.Add(new Gizmox.WebGUI.Common.Resources.IconResourceHandle(menu.Icon)); objTabControls.ImageIndex = imageIdx; imageIdx++; } Session.MainForm.navigationMenu.Controls.Add(objTabControls); } } } catch (Exception ex) { ExceptionHandling.HandleException(ex); } }
/// <summary> /// Gets the tab class. /// </summary> /// <param name="htmlHelper">The HTML helper.</param> /// <param name="tab">The tab.</param> /// <returns></returns> public static MvcHtmlString GetTabClass(this HtmlHelper htmlHelper, NavigationTab tab) { return(new MvcHtmlString(htmlHelper.ViewBag.AtiveTab == tab ? $"class=\"active\"" : string.Empty)); }