public Dictionary <string, object> AddSetting(SettingModel model) { PredicSettingBll PredicSettingBll = new PredicSettingBll(); // Type t = typeof(SettingModel); string path = HttpContext.Current.Server.MapPath("/App_Data/selfsetting.xml"); XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(path); // PropertyInfo[] properties = t.GetProperties(); xmldoc.SelectSingleNode("root").SelectSingleNode("selecttimes").Attributes[0].Value = model.selecttimes; xmldoc.SelectSingleNode("root").SelectSingleNode("weekendbili").Attributes[0].Value = model.weekendbili; xmldoc.SelectSingleNode("root").SelectSingleNode("mothtimes").Attributes[0].Value = model.mothtimes.ToString(); xmldoc.SelectSingleNode("root").SelectSingleNode("showcount").Attributes[0].Value = model.showcount.ToString(); xmldoc.SelectSingleNode("root").SelectSingleNode("daorutime").Attributes[0].Value = model.daorutime; xmldoc.SelectSingleNode("root").SelectSingleNode("daorudir").Attributes[0].Value = model.daorudir; xmldoc.SelectSingleNode("root").SelectSingleNode("daorunowdate").Attributes[0].Value = model.daorunowdate; xmldoc.Save(path); if (string.IsNullOrEmpty(model.daorutime)) { var scheduler = StdSchedulerFactory.GetDefaultScheduler(); if (scheduler.CheckExists(new TriggerKey("trigger", "triggers"))) { scheduler.UnscheduleJob(new TriggerKey("trigger", "triggers")); } } else { PredicSettingBll.ZiDongDaoRu(model.daorutime); } return(new Dictionary <string, object> { { "code", "1" } }); }