// 改 public bool Update(W_Menu menu) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("update [W_Menu] set WID=@WID,MenuName=@MenuName,MenuType=@MenuType,MenuURL=@MenuURL,MenuKey=@MenuKey,PMenuID=@PMenuID,ResponseType=@ResponseType,ResourcesID=@ResourcesID,CreateTime=@CreateTime,IsDelete=@IsDelete,Sort=@Sort where MenuID=@MenuID", new SqlParameter("@MenuID", menu.MenuID), new SqlParameter("@WID", menu.WID), new SqlParameter("@MenuName", menu.MenuName), new SqlParameter("@MenuType", menu.MenuType), new SqlParameter("@MenuURL", menu.MenuURL), new SqlParameter("@MenuKey", menu.MenuKey), new SqlParameter("@PMenuID", menu.PMenuID), new SqlParameter("@ResponseType", menu.ResponseType), new SqlParameter("@ResourcesID", menu.ResourcesID), new SqlParameter("@CreateTime", menu.CreateTime), new SqlParameter("@IsDelete", menu.IsDelete),new SqlParameter("@Sort",menu.Sort)); return rows > 0; } }
// 增 public bool Add(W_Menu menu) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("insert into [W_Menu] values (@MenuID,@WID,@MenuName,@MenuType,@MenuURL,@MenuKey,@PMenuID,@ResponseType,@ResourceID,@CreateTime,@IsDelete,@Sort)", new SqlParameter("@MenuID", menu.MenuID), new SqlParameter("@WID", menu.WID), new SqlParameter("@MenuName", menu.MenuName), new SqlParameter("@MenuType", menu.MenuType), new SqlParameter("@MenuURL", menu.MenuURL), new SqlParameter("@MenuKey", menu.MenuKey), new SqlParameter("@PMenuID", menu.PMenuID), new SqlParameter("@ResponseType", menu.ResponseType), new SqlParameter("@ResourecesID", menu.ResourcesID), new SqlParameter("@CreateTime", menu.CreateTime), new SqlParameter("@IsDelete", menu.IsDelete), new SqlParameter("@Sort", menu.Sort)); return(rows > 0); } }
// 增 public bool Add(W_Menu menu) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("insert into [W_Menu] values (@MenuID,@WID,@MenuName,@MenuType,@MenuURL,@MenuKey,@PMenuID,@ResponseType,@ResourceID,@CreateTime,@IsDelete,@Sort)", new SqlParameter("@MenuID", menu.MenuID), new SqlParameter("@WID", menu.WID), new SqlParameter("@MenuName", menu.MenuName), new SqlParameter("@MenuType", menu.MenuType), new SqlParameter("@MenuURL", menu.MenuURL), new SqlParameter("@MenuKey", menu.MenuKey), new SqlParameter("@PMenuID", menu.PMenuID), new SqlParameter("@ResponseType", menu.ResponseType), new SqlParameter("@ResourecesID", menu.ResourcesID), new SqlParameter("@CreateTime", menu.CreateTime), new SqlParameter("@IsDelete", menu.IsDelete),new SqlParameter("@Sort",menu.Sort)); return rows > 0; } }
// 改 public bool Update(W_Menu menu) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("update [W_Menu] set WID=@WID,MenuName=@MenuName,MenuType=@MenuType,MenuURL=@MenuURL,MenuKey=@MenuKey,PMenuID=@PMenuID,ResponseType=@ResponseType,ResourcesID=@ResourcesID,CreateTime=@CreateTime,IsDelete=@IsDelete,Sort=@Sort where MenuID=@MenuID", new SqlParameter("@MenuID", menu.MenuID), new SqlParameter("@WID", menu.WID), new SqlParameter("@MenuName", menu.MenuName), new SqlParameter("@MenuType", menu.MenuType), new SqlParameter("@MenuURL", menu.MenuURL), new SqlParameter("@MenuKey", menu.MenuKey), new SqlParameter("@PMenuID", menu.PMenuID), new SqlParameter("@ResponseType", menu.ResponseType), new SqlParameter("@ResourcesID", menu.ResourcesID), new SqlParameter("@CreateTime", menu.CreateTime), new SqlParameter("@IsDelete", menu.IsDelete), new SqlParameter("@Sort", menu.Sort)); return(rows > 0); } }
// 删 public bool Delete(W_Menu menu) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("delete from [W_Menu] where MenuID=@MenuID", new SqlParameter("@MenuID", menu.MenuID)); return rows > 0; } }
// 删 public bool Delete(W_Menu menu) { using (SqlHelper helper = WechatDataBaseHelper.Create()) { int rows = helper.ExecuteNonQuery("delete from [W_Menu] where MenuID=@MenuID", new SqlParameter("@MenuID", menu.MenuID)); return(rows > 0); } }
public List <W_Menu> GetChildButtons(W_Menu parent) { return(GetAll().Where(temp => temp.PMenuID == parent.MenuID).ToList()); }
// 改 public bool Update(W_Menu menu) { return(new W_MenuDAL().Update(menu)); }
// 删 public bool Delete(W_Menu menu) { return(new W_MenuDAL().Delete(menu)); }
// 增 public bool Add(W_Menu menu) { return(new W_MenuDAL().Add(menu)); }
public static bool SaveToDataBase(Menu menu, string appid) { try { #region delete current database menu W_WeChatInfoBLL weChatInfoBll = new W_WeChatInfoBLL(); W_WeChatInfo weChatInfo = weChatInfoBll.GetByAppID(appid); W_MenuBLL menuBll = new W_MenuBLL(); List <W_Menu> menus = menuBll.GetByWeChatInfo(weChatInfo);// 一级菜单 foreach (W_Menu wMenu in menus) { List <W_Menu> subMenus = menuBll.GetChildButtons(wMenu); foreach (W_Menu subMenu in subMenus) { menuBll.Delete(subMenu); } menuBll.Delete(wMenu); } #endregion #region add current to database List <W_Menu> addList = new List <W_Menu>(); foreach (var button in menu.Button) { W_Menu w = new W_Menu(); w.MenuID = Guid.NewGuid().ToString(); w.WID = weChatInfo.WID; w.MenuName = button.Name; if (button.Type == MenuButtonType.Click) { w.MenuType = "click"; w.MenuKey = button.Key; } else if (button.Type == MenuButtonType.View) { w.MenuType = "view"; w.MenuURL = button.Key; } w.PMenuID = "0"; w.ResponseType = ""; w.ResourcesID = ""; w.CreateTime = DateTime.Now; w.IsDelete = 0; addList.Add(w); foreach (var subButton in button.SubButton) { W_Menu ww = new W_Menu(); ww.MenuID = Guid.NewGuid().ToString(); ww.WID = Guid.NewGuid().ToString(); ww.MenuName = subButton.Name; if (subButton.Type == MenuButtonType.Click) { ww.MenuType = "click"; ww.MenuKey = subButton.Key; } else if (subButton.Type == MenuButtonType.View) { ww.MenuType = "view"; ww.MenuURL = subButton.Url; } ww.PMenuID = w.MenuID; ww.ResponseType = ""; ww.ResourcesID = ""; ww.CreateTime = DateTime.Now; ww.IsDelete = 0; addList.Add(ww); } } foreach (var temp in addList) { menuBll.Add(temp); } return(true); #endregion } catch { return(false); } }
static void Game_OnGameLoad() { menu = new Menu("Original Gragas", "menu", true); Menu TargetMenu = menu.AddSubMenu(new Menu("Target Selector", "ts")); TargetMenu.AddItem(new MenuItem("DamageType", "AD Gragas or AP Gragas").SetValue(new StringList(new[] { "Physical Damage", "Magical Damage" }, 1))); Menu OrbwalkerMenu = menu.AddSubMenu(new Menu("Orbwalker", "Orbwalker")); orbwalker = new Orbwalking.Orbwalker(OrbwalkerMenu); List <string> list = new List <string> { "Target Selector" }; int i = 1; foreach (AIHeroClient unit in HeroManager.Enemies) { list.Add(unit.ChampionName); i = i + 1; } W_Menu = menu.AddSubMenu(new Menu("Gragas W", "W")); W_Menu.AddItem(new MenuItem("useW", "Let script use gragas W").SetValue(true)); W_Menu.AddItem(new MenuItem("jungleW", "Clear jungle with W").SetValue(true)); W_Menu.AddItem(new MenuItem("laneclearW", "Laneclear with w").SetValue(true)); W_Menu.AddItem(new MenuItem("num_w", "Number of minions to W").SetValue(new Slider(2, 1, 4))); W_Menu.AddItem(new MenuItem("comboW", "Use W in combo").SetValue(true)); E_Menu = menu.AddSubMenu(new Menu("Gragas E", "E")); E_Menu.AddItem(new MenuItem("useE", "Let script use gragas E").SetValue(true)); E_Menu.AddItem(new MenuItem("draw", "Draw Gragas E range").SetValue(true)); E_Menu.AddItem(new MenuItem("focus_unit", "Force bellyslam unit").SetValue(new StringList(list.ToArray(), 0))); E_Menu.AddItem(new MenuItem("jungleE", "Clear jungle with E").SetValue(true)); barrel = menu.AddSubMenu(new Menu("Gragas Q", "Q")); barrel.AddItem(new MenuItem("draw", "Draw Q range").SetValue(true)); Q_LANECLEAR = barrel.AddSubMenu(new Menu("Q Laneclear settings", "QLaneClear")); Q_LANECLEAR.AddItem(new MenuItem("useQ", "Use Q in lane and jungle clear").SetValue(true)); Q_LANECLEAR.AddItem(new MenuItem("min_num", "Only Q x minions").SetValue(new Slider(3, 1, 7))); Q_Auto = barrel.AddSubMenu(new Menu("Auto Detonate Q", "QSecondCast")); Q_Auto.AddItem(new MenuItem("useQ", "Automatically detonate Q").SetValue(true)); Q_Auto.AddItem(new MenuItem("combo", "Auto detonate in combo").SetValue(true)); Q_Auto.AddItem(new MenuItem("farm", "Auto detonate Q in farming").SetValue(true)); Q_Auto.AddItem(new MenuItem("num_farm", "Number of minions to farm lasthit").SetValue(new Slider(2, 1, 7))); Q_Auto.AddItem(new MenuItem("num_clear", "Number of minions to hit clear").SetValue(new Slider(5, 1, 7))); Ult = menu.AddSubMenu(new Menu("Gragas ult", "R")); Ult.AddItem(new MenuItem("draw", "Draw ult range").SetValue(true)); R_Insec = Ult.AddSubMenu(new Menu("Insec settings", "R_Insec")); R_Insec.AddItem(new MenuItem("min_num", "Only ult x enemies").SetValue(new Slider(2, 1, 5))); R_Insec.AddItem(new MenuItem("force_key", "Force insec key").SetValue(new KeyBind("T".ToCharArray()[0], KeyBindType.Press))); R_Insec.AddItem(new MenuItem("focus_unit", "Force insec unit").SetValue(new StringList(list.ToArray(), 0))); R_Insec.AddItem(new MenuItem("barrel_use", "Do ult barrel in combo").SetValue(true)); R_Barrel = Ult.AddSubMenu(new Menu("Q -> R combo settings", "R_Barrel")); R_Barrel.AddItem(new MenuItem("focus_unit", "Force windygragas combo unit").SetValue(new StringList(list.ToArray(), 0))); R_Barrel.AddItem(new MenuItem("auto_combo", "Automatically perform combo if will kill").SetValue(true)); menu.AddToMainMenu(); Game.OnUpdate += OnUpdate; Drawing.OnDraw += OnDraw; GameObject.OnCreate += OnCreateObj; GameObject.OnDelete += OnDeleteObj; E.bellyslam.SetSkillshot(0, E.hitradius, 1300, true, SkillshotType.SkillshotLine); Q.barrel.SetSkillshot(0, 300, 550, false, SkillshotType.SkillshotCircle); }
public static bool SaveToDataBase(Menu menu, string appid) { try { #region delete current database menu W_WeChatInfoBLL weChatInfoBll = new W_WeChatInfoBLL(); W_WeChatInfo weChatInfo = weChatInfoBll.GetByAppID(appid); W_MenuBLL menuBll = new W_MenuBLL(); List<W_Menu> menus = menuBll.GetByWeChatInfo(weChatInfo);// 一级菜单 foreach (W_Menu wMenu in menus) { List<W_Menu> subMenus = menuBll.GetChildButtons(wMenu); foreach (W_Menu subMenu in subMenus) { menuBll.Delete(subMenu); } menuBll.Delete(wMenu); } #endregion #region add current to database List<W_Menu> addList = new List<W_Menu>(); foreach (var button in menu.Button) { W_Menu w = new W_Menu(); w.MenuID = Guid.NewGuid().ToString(); w.WID = weChatInfo.WID; w.MenuName = button.Name; if (button.Type == MenuButtonType.Click) { w.MenuType = "click"; w.MenuKey = button.Key; } else if (button.Type == MenuButtonType.View) { w.MenuType = "view"; w.MenuURL = button.Key; } w.PMenuID = "0"; w.ResponseType = ""; w.ResourcesID = ""; w.CreateTime = DateTime.Now; w.IsDelete = 0; addList.Add(w); foreach (var subButton in button.SubButton) { W_Menu ww = new W_Menu(); ww.MenuID = Guid.NewGuid().ToString(); ww.WID = Guid.NewGuid().ToString(); ww.MenuName = subButton.Name; if (subButton.Type == MenuButtonType.Click) { ww.MenuType = "click"; ww.MenuKey = subButton.Key; } else if (subButton.Type == MenuButtonType.View) { ww.MenuType = "view"; ww.MenuURL = subButton.Url; } ww.PMenuID = w.MenuID; ww.ResponseType = ""; ww.ResourcesID = ""; ww.CreateTime = DateTime.Now; ww.IsDelete = 0; addList.Add(ww); } } foreach (var temp in addList) { menuBll.Add(temp); } return true; #endregion } catch { return false; } }
// 改 public bool Update(W_Menu menu) { return new W_MenuDAL().Update(menu); }
public List<W_Menu> GetChildButtons(W_Menu parent) { return GetAll().Where(temp => temp.PMenuID == parent.MenuID).ToList(); }
// 删 public bool Delete(W_Menu menu) { return new W_MenuDAL().Delete(menu); }
// 增 public bool Add(W_Menu menu) { return new W_MenuDAL().Add(menu); }