public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.Cache.SetNoStore(); SM.YuQing.BLL.Config bll = new SM.YuQing.BLL.Config(); SM.YuQing.Model.Config config = bll.GetModelByName("SearchLevels"); context.Response.Write(JsonConvert.SerializeObject(config)); }
public void ProcessRequest(HttpContext context) { string count = context.Request.Form["Count"]; bool success; string errorMsg = ""; context.Response.ContentType = "text/plain"; context.Response.Cache.SetNoStore(); string clientip = context.Request.UserHostAddress; SM.YuQing.BLL.Config bll = new SM.YuQing.BLL.Config(); SM.YuQing.Model.Config config = bll.GetModelByName("SearchLevels"); config.Count = Convert.ToInt32(count); config.UpdatePerson = context.User.Identity.Name; config.UpdateTime = DateTime.Now; success = bll.Update(config); Hashtable ht = new Hashtable(); if (success) { ht.Add("success", true); SM.YuQing.BLL.Log.Add("操作", context.User.Identity.Name + " 修改配置", 0, 0, clientip); } else { if (errorMsg == "") { ht.Add("errorMsg", "Some errors occured."); } else { ht.Add("errorMsg", errorMsg); } } context.Response.Write(JsonConvert.SerializeObject(ht)); }
void Global_ExecuteTask(object sender, System.Timers.ElapsedEventArgs e) { SM.YuQing.BLL.Regions bllRegions = new SM.YuQing.BLL.Regions(); List <SM.YuQing.Model.Regions> regions = bllRegions.GetModelList(""); SM.YuQing.BLL.MonitorInfos bllInfos = new SM.YuQing.BLL.MonitorInfos(); SM.YuQing.BLL.Config bllConfig = new SM.YuQing.BLL.Config(); int searchLevel = bllConfig.GetSearchLevels(); foreach (SM.YuQing.Model.Regions region in regions) { //每天下午16点监测一次 if (DateTime.Now.Hour == 16) { bllInfos.GetMonitorInfos(region, region.Keyword, searchLevel); } //每小时监测一次 bllInfos.GetMonitorInfos(region, "SM", searchLevel); } //foreach (SM.YuQing.Model.MonitorInfos item in infos) //{ // bllInfos.Add(item); //} //SM.YuQing.BLL.MonitorWebs bllwebs = new SM.YuQing.BLL.MonitorWebs(); ////SM.YuQing.Model.MonitorWebs modelwebs = bllwebs.GetModel(7); //List<SM.YuQing.Model.MonitorWebs> webs = bllwebs.GetModelList(""); //SM.YuQing.BLL.MonitorInfos bllinfos = new SM.YuQing.BLL.MonitorInfos(); //List<SM.YuQing.Model.MonitorInfos> infos = bllinfos.GetMonitorInfos(webs, "SM"); //foreach (SM.YuQing.Model.MonitorInfos item in infos) //{ // bllinfos.Add(item); //} }