protected static int DeleteAll(Type t, ICollection pks) { const string CouldNotDeleteMessage = "Não foi possível excluir o[:s] registro[:s] selecionado[:s].\n" + "Verifique se esse[:s] registro[:s] est[á:ão] relacionado[:s] " + "a outro[:s] dado[:s] do sistema."; try { return(ActiveRecordBase.DeleteAll(t, pks)); } catch (TargetInvocationException ex) { if (ex.InnerException is ActiveRecordException) { throw new CouldNotDeleteException(PluralForm.Format(pks.Count, CouldNotDeleteMessage), ex); } throw; } catch (ActiveRecordException ex) { throw new CouldNotDeleteException(PluralForm.Format(pks.Count, CouldNotDeleteMessage), ex); } #if !DO_NOT_USE_CUSTOM_MESSAGES catch (CouldNotDeleteException ex) { throw new CouldNotDeleteException(PluralForm.Format(pks.Count, CouldNotDeleteMessage), ex); } #endif }
/// <summary>Delete letter and all containing Items</summary> public void Destroy() { if (IncludedItemCount > 0) { ActiveRecordBase <ItemRecord> .DeleteAll("MailId = " + Guid); _items = null; } Delete(); }
/// <summary>Delete letter and all containing Items</summary> public void Destroy() { if (this.IncludedItemCount > 0) { ActiveRecordBase <ItemRecord> .DeleteAll("MailId = " + (object)this.Guid); this._items = (ICollection <ItemRecord>)null; } this.Delete(); }
private static bool DeleteCharAccessories(uint charId) { try { ActiveRecordBase <SpellRecord> .DeleteAll("OwnerId = " + (object)charId); ActiveRecordBase <AuraRecord> .DeleteAll("OwnerId = " + (object)charId); ActiveRecordBase <ItemRecord> .DeleteAll("OwnerId = " + (object)charId); ActiveRecordBase <SkillRecord> .DeleteAll("OwnerId = " + (object)charId); ActiveRecordBase <SpecProfile> .DeleteAll("CharacterId = " + (object)charId); ActiveRecordBase <ReputationRecord> .DeleteAll("OwnerId = " + (object)charId); ActiveRecordBase <QuestRecord> .DeleteAll("OwnerId = " + (object)charId); ActiveRecordBase <SummonedPetRecord> .DeleteAll("OwnerLowId = " + (object)charId); ActiveRecordBase <PermanentPetRecord> .DeleteAll("OwnerLowId = " + (object)charId); MailMgr.ReturnValueMailFor(charId); ActiveRecordBase <MailMessage> .DeleteAll("ReceiverId = " + (object)charId); Singleton <RelationMgr> .Instance.RemoveRelations(charId); InstanceMgr.RemoveLog(charId); Singleton <GroupMgr> .Instance.RemoveOfflineCharacter(charId); ActiveRecordBase <AchievementRecord> .DeleteAll("CharacterId = " + (object)charId); ActiveRecordBase <AchievementProgressRecord> .DeleteAll("CharacterId = " + (object)charId); return(true); } catch (Exception ex) { LogUtil.ErrorException(ex, "Failed to delete character with Id: " + (object)charId, new object[0]); return(false); } }
public static void DeleteChar(uint charId) { ServerApp <WCell.RealmServer.RealmServer> .IOQueue.ExecuteInContext((Action)(() => { Character character = WCell.RealmServer.Global.World.GetCharacter(charId); uint guildId; if (character != null) { guildId = character.GuildId; character.Client.Disconnect(false); } else { guildId = CharacterRecord.GetGuildId(charId); } if (!CharacterRecord.DeleteCharAccessories(charId)) { return; } CharacterRecord.DeleteFromGuild(charId, guildId); ActiveRecordBase <CharacterRecord> .DeleteAll("Guid = " + (object)charId); })); }
/// <summary> /// 根据实体删除 /// </summary> /// <param name="entity"></param> public void DelelteAll(string sqlWhere) { ActiveRecordBase.DeleteAll(typeof(T), sqlWhere); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Order)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Company)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(uf_CarGPS_WFRoute)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Employee)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(QuestionContainer)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(modeDataShare_135_set)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(ReferenceEstrato)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Workflow_requestbase)); }
public new static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Client)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(OtherDbPost)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Person)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Blog2)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(NullableModel)); }
public new static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(PersonEntity)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Product)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Entity)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Award)); }
public new static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(Repository)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(PostLazy)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(uf_CarGPS_WFRangeOperateRecord)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(workflow_bill)); }
public void DeleAll() { ActiveRecordBase.DeleteAll(typeof(T)); }
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(SurveyEstrato)); }
public void DelByWhere(string strWhere) { ActiveRecordBase.DeleteAll(typeof(T), strWhere); }