Ejemplo n.º 1
0
        /// <summary>
        /// 提交菜单,保存/修改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public JsonResult AjaxSubmitMenu(UserMenu model)
        {
            BaseResult res = new BaseResult();

            //解码
            model.Icon      = HttpUtility.UrlDecode(model.Icon);
            model.MenuLevel = model.ParentId == 0 ? 1 : 2;
            bool isEdit = model.Id > 0;
            int  r      = MenuLogic.SaveMenu(model);

            if (r > 0)
            {
                res.State   = (int)State.Success;
                res.Message = "保存成功";

                SaveUserLog(AuthUser.LoginName + (isEdit ? "修改" : "添加") + "了菜单" + model.MenuName, LogLevel.Sensitive, AuthUser.LoginName, "", "菜单操作");
                CacheHelper.ClearMenuCache();
                //  BaseLogic.DisEntity();
            }
            else
            {
                res.State   = State.Falid;
                res.Message = "保存失败";
            }

            return(Json(res));
        }
Ejemplo n.º 2
0
        private async void OnSave(object obj)
        {
            IsBusy = true;

            try
            {
                // Thuc hien cong viec tai day
                var menuLogic = new MenuLogic(_dbContext);

                await menuLogic.UpdateAsync(new Menu
                {
                    Id = Menu.Id,
                    ImageIcon = Menu.ImageIcon,
                    MenuName = Menu.MenuName
                });

                var param = new NavigationParameters();
                param.Add(Keys.MENU, Menu);
                await NavigationService.GoBackAsync(param);
            }
            catch (Exception e)
            {
                await ShowError(e);
            }
            finally
            {
                IsBusy = false;
            }

        }
Ejemplo n.º 3
0
        private async void OnDelete(object obj)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                // Thuc hien cong viec tai day
                var canDelete = await DisplayDeleteAlertAsync();

                if (canDelete)
                {
                    var menuLogic = new MenuLogic(_dbContext);
                    await menuLogic.DeleteAsync(Menu.Id);
                    Menu.IsDeleted = 1;
                    var param = new NavigationParameters();
                    param.Add(Keys.MENU, Menu);

                    await NavigationService.GoBackAsync(param);
                }
            }
            catch (Exception e)
            {
                await ShowError(e);
            }
            finally
            {
                IsBusy = false;
            }

        }
Ejemplo n.º 4
0
        public ActionResult AddMenu(MenuViewModel viewModel)
        {
            try
            {
                if (viewModel != null)
                {
                    MenuLogic menuLogic = new MenuLogic();

                    List <MENU> MenuList = menuLogic.GetEntitiesBy(m => m.Display_Name == viewModel.Menu.Action && m.Controller == viewModel.Menu.Controller && m.Menu_Group_Id == viewModel.MenuGroup.Menu_Group_Id);
                    if (MenuList.Count > 0)
                    {
                        SetMessage("This Menu has already been added to this menuGroup!", Message.Category.Error);
                        RetainDropDown(viewModel);
                        return(View(viewModel));
                    }

                    viewModel.Menu.Activated     = true;
                    viewModel.Menu.Menu_Group_Id = viewModel.MenuGroup.Menu_Group_Id;
                    menuLogic.Create(viewModel.Menu);

                    SetMessage("Operation Successful! ", Message.Category.Information);
                    return(RedirectToAction("AddMenu"));
                }
            }
            catch (Exception ex)
            {
                SetMessage("Error!" + ex.Message, Message.Category.Error);
            }

            RetainDropDown(viewModel);
            return(View(viewModel));
        }
Ejemplo n.º 5
0
        public HttpResponseMessage GetMenu()
        {
            MenuLogic menuLogic = new MenuLogic();
            Menu      menu      = menuLogic.GetMenu();

            return(Request.CreateResponse(HttpStatusCode.OK, menu));
        }
Ejemplo n.º 6
0
 public List <MenuList> GetMenus(string ids)
 {
     using (MenuLogic logic = new MenuLogic())
     {
         return(logic.GetMenus(ids));
     }
 }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     ml         = GameObject.Find("PhotonDontDestroy").GetComponent <MenuLogic>();
     decisiones = ml.GetDecisionesTomadas();
     sentences  = new Queue <string>();
     StartDialogue();
 }
Ejemplo n.º 8
0
 public BaseObject EditMenu(MenuEntity menu)
 {
     using (MenuLogic logic = new MenuLogic(db))
     {
         return(logic.EditMenu(menu));
     }
 }
Ejemplo n.º 9
0
 public BaseObject DelMenu(int id)
 {
     using (MenuLogic logic = new MenuLogic(db))
     {
         return(logic.DelMenu(id));
     }
 }
Ejemplo n.º 10
0
 public List <MenuEntity> GetAllPages(int?systemID)
 {
     using (MenuLogic logic = new MenuLogic(db))
     {
         return(logic.GetAllPages(systemID));
     }
 }
Ejemplo n.º 11
0
        public HttpResponseMessage DeletePlatillo(int codigoPlatillo)
        {
            MenuLogic menuLogic = new MenuLogic();
            Platillo  platillo  = menuLogic.Delete(codigoPlatillo);

            return(Request.CreateResponse(HttpStatusCode.OK, platillo));
        }
Ejemplo n.º 12
0
        public ActionResult ConfirmDeleteMenu(int mid)
        {
            try
            {
                viewModel = new MenuViewModel();
                if (mid > 0)
                {
                    MenuLogic menuLogic = new MenuLogic();
                    viewModel.Menu = menuLogic.GetEntityBy(x => x.Menu_Id == mid);
                    if (viewModel.Menu != null)
                    {
                        viewModel.MenuGroup = viewModel.Menu.MENU_GROUP;
                    }

                    RetainDropDown(viewModel);
                    return(View(viewModel));
                }
            }
            catch (Exception ex)
            {
                SetMessage("Error! " + ex.Message, Message.Category.Error);
            }

            RetainDropDown(viewModel);
            return(View(viewModel));
        }
Ejemplo n.º 13
0
 // Start is called before the first frame update
 void Start()
 {
     ml         = GameObject.Find("PhotonDontDestroy").GetComponent <MenuLogic>();
     coords     = ml.getCoords();
     decidido   = false;
     decTomadas = ml.GetDecisionesTomadas();
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 修改页面
 /// </summary>
 /// <param name="param"></param>
 /// <returns></returns>
 public BaseObject EditPage(MenuEntity param)
 {
     using (MenuLogic logic = new MenuLogic())
     {
         return(logic.EditPage(param));
     }
 }
Ejemplo n.º 15
0
 public BaseObject DisEnableMenu(int id, string state, string type)
 {
     using (MenuLogic logic = new MenuLogic(db))
     {
         return(logic.DisEnableMenu(id, state, type));
     }
 }
Ejemplo n.º 16
0
 public List <MenuEntity> GetAllPages(UserAuth list)
 {
     using (MenuLogic logic = new MenuLogic())
     {
         return(logic.GetAllPages(list));
     }
 }
Ejemplo n.º 17
0
 /// <summary>
 /// 页面获取
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public PageEntity GetPageByID(int id)
 {
     using (MenuLogic logic = new MenuLogic())
     {
         return(logic.GetPageByID(id));
     }
 }
Ejemplo n.º 18
0
 public List <MenuTree> GetTreeMenu()
 {
     using (MenuLogic logic = new MenuLogic())
     {
         return(logic.GetTreeMenu());
     }
 }
Ejemplo n.º 19
0
    private void Awake()
    {
        mp = GameObject.Find("MainMenuDontDestroy").GetComponent <MenuPrincipal>();

        if (PhotonNetwork.connectionState.ToString().Equals("Disconnected"))
        {
            PhotonNetwork.ConnectUsingSettings(versionName);
        }
        else
        {
            buttonCon.SetActive(false);

            MenuLogic ml = GameObject.Find("PhotonDontDestroy").GetComponent <MenuLogic>();
            if (mp.quickGame)
            {
                ml.joinOrCreateRoomQuick();
            }
            else
            {
                exito.SetActive(true);
            }
        }

        //Debug.Log("Conectandose a photon");
    }
Ejemplo n.º 20
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            scene = new Scene();

            director = new Director(graphics, Content);

            /*Logic matchLogic = new MatchLogic(director, scene, new[] { false });
             * matchLogic.Initialize();
             *          Screen matchScreen = new MatchScreen(director, scene, matchLogic.BaseScreenSize, new []{false});
             *
             * director.AddLogic(matchLogic);
             * director.AddScreen(matchScreen);*/

            Logic menuLogic = new MenuLogic(director, scene);

            menuLogic.Initialize();
            Screen menuScreen = new DefaultScreen(director, scene, menuLogic.BaseScreenSize);

            director.AddLogic(menuLogic);
            director.AddScreen(menuScreen);



            // Player MatchPlayer = new Player(PlayerIndex.One, new MatchInputMapper());

            base.Initialize();
        }
Ejemplo n.º 21
0
 public List <MenuList> GetMenus(string ids, int?systemID)
 {
     using (MenuLogic logic = new MenuLogic(db))
     {
         return(logic.GetMenus(ids, systemID));
     }
 }
Ejemplo n.º 22
0
 public BaseObject InsertMenu(MenuEntity menu)
 {
     using (MenuLogic logic = new MenuLogic())
     {
         return(logic.InsertMenu(menu));
     }
 }
Ejemplo n.º 23
0
 public List <MenuTree> GetTreeMenu(int?systemID)
 {
     using (MenuLogic logic = new MenuLogic(db))
     {
         return(logic.GetTreeMenu(systemID));
     }
 }
Ejemplo n.º 24
0
 public MenuEntity GetMenuByID(int id)
 {
     using (MenuLogic logic = new MenuLogic(db))
     {
         return(logic.GetMenuByID(id));
     }
 }
Ejemplo n.º 25
0
        public ActionResult EditMenu(MenuViewModel viewModel)
        {
            try
            {
                MenuLogic menuLogic = new MenuLogic();
                viewModel.Menu.MENU_GROUP = viewModel.MenuGroup;
                bool isUpdated = menuLogic.Modify(viewModel.Menu);

                if (isUpdated == false)
                {
                    SetMessage("Edit Unsuccessful! ", Message.Category.Error);
                    return(RedirectToAction("EditMenu", new { mid = viewModel.Menu.Menu_Id }));
                }

                SetMessage("Operation Successful!", Message.Category.Information);
                return(RedirectToAction("ViewMenuByMenuGroup"));
            }
            catch (Exception ex)
            {
                SetMessage("Error! " + ex.Message, Message.Category.Error);
            }

            RetainDropDown(viewModel);
            return(View("ViewMenuByMenuGroup", viewModel));
        }
Ejemplo n.º 26
0
        public async Task <string> GetMenu()
        {
            ApplicationUser user = await _userManager.FindByNameAsync(User.Identity.Name);

            var superId = _setting.GetSuperId();
            var obj     = new MenuLogic(_context);
            var obj1    = new SubMenuLogic(_context);

            string data = "";

            if (User.Identity.Name == superId)
            {
                data = await obj.SelectVisibleData();
            }
            else
            {
                var role = await _userManager.GetRolesAsync(user);

                data = obj.SelectVisibleData(role[0]);
            }

            var data1 = obj1.SelectVisibleData();

            var format = new { top = data, left = data1 };

            return(Tools.ConvertToJSON(format));
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 根据user绑定菜单
        /// </summary>
        private void BindFunction()
        {
            MenuLogic logic = new MenuLogic();
            DirModel  dml   = new DirModel();

            dml.Add("@user_no", LoginUser.LoginUser);
            DataTable     dtMenu  = logic.QueryMenu(dml);
            StringBuilder strMenu = new StringBuilder();

            DataRow[] drLevelones = dtMenu.Select("function_level=1", "function_sort asc");
            foreach (DataRow drLevelone in drLevelones)
            {
                strMenu.Append(@"<li> <h4>" + drLevelone["function_name"].ToString() + @"</h4>");
                DataRow[] drLeveltwos = dtMenu.Select("function_level=2 and function_parent_id='" + drLevelone["function_id"].ToString() + "'", "function_sort asc");
                if (drLeveltwos.Length > 0)
                {
                    strMenu.Append(@"<div class=""list-item none"">");
                    foreach (DataRow drLeveltwo in drLeveltwos)
                    {
                        strMenu.Append(@"  <p> <a href=""" + drLeveltwo["function_url"].ToString() + @""" onclick="" return setUrl('" + drLeveltwo["function_url"].ToString() + @"')"">" + drLeveltwo["function_name"].ToString() + @"</a></p>");
                    }
                    strMenu.Append(@" </div>");
                }
                strMenu.Append(@" </li>");
            }

            J_navlist.InnerHtml = strMenu.ToString();
        }
Ejemplo n.º 28
0
        public static List <SelectListItem> PopulateMenuSelectListItem()
        {
            try
            {
                MenuLogic   menuLogic = new MenuLogic();
                List <MENU> menuList  = menuLogic.GetAll();
                if (menuList == null || menuList.Count <= 0)
                {
                    return(new List <SelectListItem>());
                }

                List <SelectListItem> MenuList = new List <SelectListItem>();

                SelectListItem list = new SelectListItem();
                list.Value = "";
                list.Text  = Select;
                MenuList.Add(list);

                foreach (MENU menu in menuList)
                {
                    SelectListItem selectList = new SelectListItem();
                    selectList.Value = menu.Menu_Id.ToString();
                    selectList.Text  = menu.Display_Name + ", In " + menu.MENU_GROUP.Name;

                    MenuList.Add(selectList);
                }

                return(MenuList.OrderBy(m => m.Text).ToList());
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 29
0
    public static void Main()
    {
        var menu = new MenuLogic();

        menu.Run();

        if (menu.SendPing || menu.TestAuth || menu.DownloadData)
        {
            using var c = new RequestClient();
            if (menu.SendPing)
            {
                Console.WriteLine(c.SendPingAsync().Result);
            }
            if (menu.TestAuth || menu.DownloadData)
            {
                var auth = AuthConfigReader.Read();
                c.Configure(auth.DevId, auth.AuthKey);
                if (menu.TestAuth)
                {
                    Console.WriteLine(c.TestSessionAsync().Result);
                }
                if (menu.DownloadData)
                {
                    var downloader = new JsonDownloader(c, "data");
                    DownloadData(downloader);
                }
            }
        }
        if (menu.GenerateData)
        {
            GenerateGodsWithSkinsFromStore();
        }
        if (menu.DownloadIcons)
        {
            GodIcons.DownloadGodIcons("img/godicon");
        }
        if (menu.CheckRemoteImages)
        {
            CheckRemoteImage().Wait();
        }
        if (menu.CombineIcons)
        {
            var files = new DirectoryInfo("img/godicon").EnumerateFiles("*.jpg").OrderBy(x => x.Name);
            GodIcons.GenerateGodIconSprites(files, "img/godicons");
        }
        if (menu.GenerateHtml)
        {
            Console.WriteLine("Generating HTML...");
            GodsHtml.GenerateGodsHtml(targetFile: "smitegods.html", new DataStore().ReadGods() !, GodIcons.ReadSpriteData("img/godicons"));
            GodsSkinsHtml.GenerateGodsHtml("god-skins.html", new DataStore().ReadGodsWithSkins() !);

            GodSkinThemeHtml.Generate("god-skin-themes.html", new DataStore().ReadGodsWithSkins() !, new DataStore().ReadGodSkinThemes());

            ItemsHtml.Generate(targetFile: "smiteitems.html", items: new DataStore().ReadItems() !);
        }

        Console.WriteLine("Done. Waiting for ENTER to exit…");
        Console.ReadLine();
    }
Ejemplo n.º 30
0
        public HttpResponseMessage SavePlatillo([FromBody] Platillo platillo)
        {
            MenuLogic menuLogic = new MenuLogic();

            menuLogic.Insert(platillo.Codigo);

            return(Request.CreateResponse(HttpStatusCode.OK));
        }
Ejemplo n.º 31
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animator>();
     menuLogic = cel.GetComponent<MenuLogic>();
 }
 // Use this for initialization
 void Start()
 {
     menuLogic = menuLogicObject.GetComponent<MenuLogic>();
 }