コード例 #1
0
        /// <summary>
        /// 处理区域代理过期
        /// </summary>
        public static void AgentAreaEnd()
        {
            List <Lebi_Agent_Area> areas = B_Lebi_Agent_Area.GetList("User_id>0 and datediff(d,Time_end,'" + System.DateTime.Now.Date + "')>" + ShopCache.GetBaseConfig().AgentEndDays + "", "");

            foreach (Lebi_Agent_Area area in areas)
            {
                area.User_id       = 0;
                area.User_UserName = "";
                B_Lebi_Agent_Area.Update(area);
            }
        }
コード例 #2
0
        /// <summary>
        /// 处理区域代理过期
        /// </summary>
        public static void AgentAreaEnd()
        {
            int d = 0;

            int.TryParse(ShopCache.GetBaseConfig().AgentEndDays, out d);
            d = 0 - d;
            List <Lebi_Agent_Area> areas = B_Lebi_Agent_Area.GetList("User_id>0 and Time_end<'" + System.DateTime.Now.Date.AddDays(d) + "')", "");

            foreach (Lebi_Agent_Area area in areas)
            {
                area.User_id       = 0;
                area.User_UserName = "";
                B_Lebi_Agent_Area.Update(area);
            }
        }
コード例 #3
0
        /// <summary>
        /// 查询对于的代理资格设置
        /// </summary>
        /// <param name="areaid"></param>
        /// <returns></returns>
        private Lebi_Agent_Area GetAgentArea(int areaid)
        {
            Lebi_Agent_Area agentarea = B_Lebi_Agent_Area.GetModel("Area_id=" + areaid + " and IsFailure=0");

            if (agentarea != null)
            {
                return(agentarea);
            }
            else
            {
                Lebi_Area area = B_Lebi_Area.GetModel(areaid);
                if (area != null)
                {
                    return(GetAgentArea(area.Parentid));
                }
            }
            return(null);
        }