Exemplo n.º 1
0
        public static DataSet GetPagerData(int intPageSize, int intCurrentPageIndex)
        {
            int num  = 0;
            int num2 = 0;

            return(AutoRly.GetPagerData(intPageSize, intCurrentPageIndex, ref num, ref num2));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        public static IList <AutoRlyInfo> GetList(int intTopCount, string strCondition)
        {
            string strSort = " Sort asc,AutoID desc ";

            return(AutoRly.GetList(intTopCount, strCondition, strSort));
        }
Exemplo n.º 6
0
 public static IList <AutoRlyInfo> GetTopNList(int intTopCount, string strSort)
 {
     return(AutoRly.GetList(intTopCount, string.Empty, strSort));
 }
Exemplo n.º 7
0
 public static IList <AutoRlyInfo> GetAllList()
 {
     return(AutoRly.GetList(0, string.Empty));
 }
Exemplo n.º 8
0
 public static AutoRlyInfo GetTopData()
 {
     return(AutoRly.GetTopData(" Sort ASC,AutoID desc "));
 }
Exemplo n.º 9
0
 public static AutoRlyInfo GetEventRly(string strReqKey)
 {
     return(AutoRly.GetByKey("事件回复", strReqKey));
 }
Exemplo n.º 10
0
 public static AutoRlyInfo GetKeyRly(string strReqKey)
 {
     return(AutoRly.GetByKey("关键字回复", strReqKey));
 }
Exemplo n.º 11
0
 public static IList <AutoRlyInfo> GetPagerList(int intCurrentPageIndex, int intPageSize, ref int intTotalCount, ref int intTotalPage)
 {
     return(AutoRly.GetPagerList("", "Sort ASC,AutoID DESC", intCurrentPageIndex, intPageSize, ref intTotalCount, ref intTotalPage));
 }
Exemplo n.º 12
0
 public static DataSet GetPagerData(string strFilter, string strCondition, int intPageSize, int intCurrentPageIndex, ref int intTotalCount, ref int intTotalPage)
 {
     return(AutoRly.GetPagerData(strFilter, strCondition, " Sort asc,AutoID desc ", intPageSize, intCurrentPageIndex, ref intTotalCount, ref intTotalPage));
 }
Exemplo n.º 13
0
 public static DataSet GetPagerData(string strCondition, int intPageSize, int intCurrentPageIndex, ref int intTotalCount, ref int intTotalPage)
 {
     return(AutoRly.GetPagerData("*", strCondition, intPageSize, intCurrentPageIndex, ref intTotalCount, ref intTotalPage));
 }