Exemple #1
0
        private void BindUserMenu(int userId)
        {
            MasterMenu        ObjMenu = new MasterMenu();
            List <MasterMenu> items   = ObjMenu.getMenuItems(userId.ToString());

            string[]      Modules = items.Select(x => x.ModuleID).Distinct().ToArray();
            StringBuilder _menu   = new StringBuilder("<ul class='sidebar-menu' data-widget='tree'>");

            foreach (string module in Modules)
            {
                var Forms = items.Where(x => x.ModuleID == module).ToArray();
                _menu.AppendFormat("<li id='liModule_{0}' class='treeview'>", Forms[0].ModuleName.Replace(" ", string.Empty).ToLower());
                _menu.AppendFormat("<a href='{0}'>", ResolveUrl("~/") + Forms[0].ModuleUrl);
                _menu.AppendFormat("<i class='fa fa-laptop'></i><span>{0}</span>", Forms[0].ModuleName);
                _menu.Append("<span class='pull-right-container'><i class='fa fa-angle-left pull-right'></i></span></a>");
                _menu.AppendFormat("<ul id='ul_{0}' class='treeview-menu'>", Forms[0].ModuleName.Replace(" ", string.Empty).ToLower());
                foreach (var item in Forms)
                {
                    _menu.AppendFormat("<li id='liForm_{2}'><a href='{0}'><i class='fa fa-circle-o'></i> &nbsp; {1}</a></li>", ResolveUrl("~/") + item.FormUrl, item.FormName, item.FormName.Replace(" ", string.Empty).ToLower());
                }
                _menu.Append("</ul>");
                _menu.Append("</li>");
            }
            _menu.Append("</ul>");

            divSidemenu.InnerHtml = _menu.ToString();
        }
Exemple #2
0
        public MasterModule([Import(typeof(IModuleHandler))] IModuleHandler handler)
        {
            window = new M0001_MasterWindow();

            menu = new MasterMenu();

            Handler = handler;
        }
Exemple #3
0
 protected override void OnResume()
 {
     if (Application.Current.Properties.ContainsKey("IsLogged"))
     {
         MainPage = new MasterMenu();
     }
     else
     {
         MainPage = new NavigationPage(new LoginPage());
     }
 }
        public async Task <ActionResult> Delete(MasterMenu model)
        {
            try
            {
                MasterMenuRepository Repository = new MasterMenuRepository();
                var result = await Repository.DeleteMasterMenu(model.MenuId, User.Identity.Name);

                if (result == true)
                {
                    return(await GetListMasterMenu());
                }
                else
                {
                    return(View(result));
                }
            }
            catch
            {
                return(View(false));
            }
        }
Exemple #5
0
 private void SetMainPage()
 {
     if (!string.IsNullOrEmpty(Settings.AccessToken))
     {
         if (DateTime.UtcNow.AddHours(2) < Settings.AccessTokenExpiration)
         {
             var vm = new LoginViewModel();
             vm.LoginCommand.Execute(null);
         }
         //MainPage = new NavigationPage(new MasterMenu()); //fixed duplicate masterdetail page
         MainPage = new MasterMenu();
     }
     else if (!string.IsNullOrEmpty(Settings.Username) &&
              !string.IsNullOrEmpty(Settings.AccessToken))
     {
         MainPage = new NavigationPage(new LoginPage());
     }
     else
     {
         MainPage = new NavigationPage(new RegisterPage());
     }
 }
        public async Task <ActionResult> Create(MasterMenu model)
        {
            try
            {
                MasterMenuRepository Repository = new MasterMenuRepository();
                var result = await Repository.CreateMasterMenu(model.MenuName, model.MenuURL, model.MenuIcon, model.MenuParentId, User.Identity.Name);

                if (result == true)
                {
                    return(await GetListMasterMenu());
                }
                else
                {
                    return(View(result));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("{0} Exception caught.", e);
                return(View(false));
            }
        }
Exemple #7
0
        public App()
        {
            // The root page of your application
            //var content = new ContentPage
            //{
            //    Title = "FTB",
            //    Content = new StackLayout
            //    {
            //        VerticalOptions = LayoutOptions.Center,
            //        Children = {
            //            new Label {
            //                HorizontalTextAlignment = TextAlignment.Center,
            //                Text = "Welcome to Xamarin Forms!"
            //            }
            //        }
            //    }
            //};
            Resources = new Styles().Resources;

            MainPage = new MasterMenu();
            //MainPage = new P();
            //MainPage = new AttendanceList();
        }