private void StaticPages(GgcmsTasks tinfo) { var info = tinfo.GetTaskConfig <StaticTaskInfo>(); GenerateStaticPages gsp = new GenerateStaticPages(info, context); gsp.Run(); }
private void UpdateTask(GgcmsTasks tinfo) { using (GgcmsDB db = new GgcmsDB()) { var ent = db.Entry(tinfo); ent.State = EntityState.Modified; db.SaveChanges(); CacheHelper.RemoveAllCache(CacheTypeNames.Tasks); } }
// POST: api/GgcmsCategories public IHttpActionResult Add(GgcmsTasks info) { info.RunTime = DateTime.Now; info.SetNextRuntime(); var result = Dbctx.GgcmsTasks.Add(info); Dbctx.SaveChanges(); ClearCache(); CacheHelper.RemoveAllCache(CacheTypeNames.Tasks); return(Ok(result)); }
// PUT: api/GgcmsCategories/5 public IHttpActionResult Edit(GgcmsTasks info) { if (Dbctx.GgcmsTasks.Where(x => x.Id == info.Id).Count() == 0) { return(BadRequest("信息不存在")); } //Dbctx.GgcmsTasks.Attach(info); //Dbctx.Entry(info).Property("goods_name").IsModified = true; info.SetNextRuntime(); var ent = Dbctx.Entry(info); ent.State = EntityState.Modified; Dbctx.SaveChanges(); ClearCache(); CacheHelper.RemoveAllCache(CacheTypeNames.Tasks); return(Ok(info)); }
// DELETE: api/GgcmsCategories/5 public IHttpActionResult Delete(int id) { GgcmsTasks oldinfo = Dbctx.GgcmsTasks.Find(id); if (oldinfo == null) { return(BadRequest("信息不存在")); } //List<int> idlist = GetDeleteIds(oldinfo.ticket_key); //var query = Dbctx.ticket_information.Where(x => idlist.Contains(x.id)); Dbctx.GgcmsTasks.Remove(oldinfo); Dbctx.SaveChanges(); ClearCache(); CacheHelper.RemoveAllCache(CacheTypeNames.Tasks); return(Ok(oldinfo)); }