public void Execute(BasePage Context) { Dictionary <String, Object> jsonDicts = new Dictionary <String, Object>(); Int32 DynamicModuleId = WebHelper.GetIntParam(Context.Request, "DynamicModuleId", 0); QueryParam qp = new QueryParam(); qp.Where.Add(new SearchParam(Playngo_ClientZone_DynamicModule._.ID, DynamicModuleId, SearchType.Equal)); Int32 DeleteCount = Playngo_ClientZone_DynamicModule.Delete(qp); if (DeleteCount > 0) { QueryParam qpItem = new QueryParam(); qpItem.Where.Add(new SearchParam(Playngo_ClientZone_DynamicItem._.DynamicID, DynamicModuleId, SearchType.Equal)); Int32 DeleteItemCount = Playngo_ClientZone_DynamicItem.Delete(qpItem); jsonDicts.Add("DeleteItemCount", DeleteItemCount); } jsonDicts.Add("DeleteCount", DeleteCount); //转换数据为json JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); ResponseString = jsSerializer.Serialize(jsonDicts); }
/// <summary> /// 删除数据所关联的所有动态模块项 /// </summary> /// <param name="LinkID"></param> /// <param name="ModuleId"></param> /// <param name="DynamicType"></param> /// <returns></returns> public static Int32 DeleteAll(Int32 LinkID, Int32 ModuleId, Int32 DynamicType) { int RecordCount = 0; var DynamicModules = FindListByFilter(LinkID, DynamicType, ModuleId); if (DynamicModules != null && DynamicModules.Count > 0) { foreach (var DynamicModule in DynamicModules) { if (DynamicModule.Delete() > 0) { RecordCount++; QueryParam qp = new QueryParam(); qp.Where.Add(new SearchParam(Playngo_ClientZone_DynamicItem._.DynamicID, DynamicModule.ID, SearchType.Equal)); qp.Where.Add(new SearchParam(Playngo_ClientZone_DynamicItem._.ModuleId, ModuleId, SearchType.Equal)); RecordCount += Playngo_ClientZone_DynamicItem.Delete(qp); } } } return(RecordCount); }