public static bool Del(int intID) { WxMenuInfo dataById = WxMenu.GetDataById(intID); bool result; if (dataById.ChildCount > 0) { result = false; } else if (BizBase.dbo.DeleteModel <WxMenuInfo>(dataById)) { if (dataById.ParentID > 0) { BizBase.dbo.UpdateTable(string.Concat(new object[] { "update weixin_WxMenu set ChildCount=ChildCount-1,ChildIDs=REPLACE(ChildIDs,',", intID, "','') where AutoID=", dataById.ParentID })); } if (!string.IsNullOrEmpty(dataById.EventKey)) { AutoRly.DelEventKey(dataById.EventKey); } result = true; } else { result = false; } return(result); }
public static DataSet GetPagerData(int intPageSize, int intCurrentPageIndex) { int num = 0; int num2 = 0; return(WxMenu.GetPagerData(intPageSize, intCurrentPageIndex, ref num, ref num2)); }
public static WxStatus Add(WxMenuInfo entity, AutoRlyInfo eventKey) { int count; if (entity.ParentID == 0) { count = WxMenu.GetCount("ParentID=0"); } else { count = WxMenu.GetCount("ParentID=" + entity.ParentID); } WxStatus result; if (entity.ParentID.Equals(0) && count > 3) { result = WxStatus.一级菜单个数不超过3个; } else if (entity.ParentID > 0 && count > 5) { result = WxStatus.二级菜单个数不超过5个; } else { if (entity.Type == "click" && eventKey != null) { AutoRly.Add(eventKey); entity.EventKey = eventKey.MsgKey; } int num = WxMenu.Add(entity); if (num > 0) { entity.AutoID = num; if (entity.ParentID.Equals(0)) { entity.RootID = num; WxMenu.Update(entity); } else { WxMenuInfo dataById = WxMenu.GetDataById(entity.ParentID); entity.RootID = dataById.RootID; dataById.ChildCount++; dataById.ChildIDs = dataById.ChildIDs + "," + num; WxMenu.Update(entity); WxMenu.Update(dataById); } result = WxStatus.增加成功; } else { result = WxStatus.增加失败; } } return(result); }
public static WxStatus Update(WxMenuInfo entity, AutoRlyInfo eventKey) { WxMenuInfo dataById = WxMenu.GetDataById(entity.AutoID); WxStatus result; if (WxMenu.Update(entity)) { if (entity.Type == "view" && !string.IsNullOrEmpty(dataById.EventKey)) { AutoRly.DelEventKey(dataById.EventKey); } else if (entity.Type == "click" && dataById.Type != "click" && eventKey != null) { AutoRly.Add(eventKey); } else if (entity.Type == "click" && dataById.Type == "click" && eventKey != null) { AutoRlyInfo eventRly = AutoRly.GetEventRly(dataById.EventKey); if (eventRly != null) { eventRly.MsgText = eventKey.MsgText; eventRly.Description = eventKey.Description; eventRly.MediaPath = eventKey.MediaPath; eventRly.LinkUrl = eventKey.LinkUrl; eventRly.AutoTimeStamp = DateTime.Now; AutoRly.Update(eventRly); } } result = WxStatus.修改成功; } else { result = WxStatus.修改失败; } return(result); }
public static IList <WxMenuInfo> GetPagerList(int intCurrentPageIndex, int intPageSize, ref int intTotalCount, ref int intTotalPage) { return(WxMenu.GetPagerList("", "Sort ASC,AutoID DESC", intCurrentPageIndex, intPageSize, ref intTotalCount, ref intTotalPage)); }
public static DataSet GetPagerData(string strFilter, string strCondition, int intPageSize, int intCurrentPageIndex, ref int intTotalCount, ref int intTotalPage) { return(WxMenu.GetPagerData(strFilter, strCondition, " Sort asc,AutoID desc ", intPageSize, intCurrentPageIndex, ref intTotalCount, ref intTotalPage)); }
public static DataSet GetPagerData(string strCondition, int intPageSize, int intCurrentPageIndex, ref int intTotalCount, ref int intTotalPage) { return(WxMenu.GetPagerData("*", strCondition, intPageSize, intCurrentPageIndex, ref intTotalCount, ref intTotalPage)); }
public static IList <WxMenuInfo> GetList(int intTopCount, string strCondition) { string strSort = " Sort asc,AutoID desc "; return(WxMenu.GetList(intTopCount, strCondition, strSort)); }
public static IList <WxMenuInfo> GetTopNList(int intTopCount, string strSort) { return(WxMenu.GetList(intTopCount, string.Empty, strSort)); }
public static IList <WxMenuInfo> GetAllList() { return(WxMenu.GetList(0, string.Empty)); }
public static WxMenuInfo GetTopData() { return(WxMenu.GetTopData(" Sort ASC,AutoID desc ")); }