Example #1
0
        /// <summary>
        /// 分派信息配置对象状态
        /// </summary>
        /// <returns></returns>
        public bool GetAgentStatus(WeixinAgentItem item)
        {
            string begin = item.begin; //.ToString("yyyy-MM-dd");
            string end   = item.end;   //.ToString("yyyy-MM-dd");

            return(DateTimeManger.Availability(DateTime.Parse(begin), DateTime.Parse(end), DateTime.Now));;
        }
Example #2
0
        private bool CheckConfig(int checkid)
        {
            bool check = false;

            AgentConfig agentConfig = new AgentConfig();
            WeixinAgent weixinAgent = agentConfig.GetConfig();

            foreach (WeixinAgentItem item in weixinAgent.agentItem)
            {
                int    id        = item.id;
                bool   authorize = item.authorize;
                string begin     = item.begin; //.ToString("yyyy-MM-dd");
                string end       = item.end;   //.ToString("yyyy-MM-dd");

                //logs.Fatal("url:"+ url + "   checkurl:"+ checkurl+ "   begin:"+ begin+ "   end:"+ end);

                if (checkid == id && authorize)
                {
                    check = DateTimeManger.Availability(DateTime.Parse(begin), DateTime.Parse(end), DateTime.Now);
                    //logs.Fatal("check:" + check);

                    if (check)
                    {
                        break;
                    }
                }
            }

            return(check);
        }
Example #3
0
        private bool CheckConfig(string checkurl)
        {
            bool check = false;

            AgentConfig agentConfig = new AgentConfig();
            WeixinAgent weixinAgent = agentConfig.GetConfig();

            foreach (WeixinAgentItem item in weixinAgent.agentItem)
            {
                string url       = item.url;
                bool   signature = item.signature;
                string begin     = item.begin; //.ToString("yyyy-MM-dd");
                string end       = item.end;   //.ToString("yyyy-MM-dd");

                //logs.Fatal("url:"+ url + "   checkurl:"+ checkurl+ "   begin:"+ begin+ "   end:"+ end);

                if (checkurl == url && signature)
                {
                    check = DateTimeManger.Availability(DateTime.Parse(begin), DateTime.Parse(end), DateTime.Now);
                    //logs.Fatal("check:" + check);

                    if (check)
                    {
                        break;
                    }
                }
            }

            return(check);
        }