示例#1
0
        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
        }
示例#2
0
        /// <summary>Delete letter and all containing Items</summary>
        public void Destroy()
        {
            if (IncludedItemCount > 0)
            {
                ActiveRecordBase <ItemRecord> .DeleteAll("MailId = " + Guid);

                _items = null;
            }

            Delete();
        }
示例#3
0
        /// <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();
        }
示例#4
0
        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);
            }
        }
示例#5
0
        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);
            }));
        }
示例#6
0
 /// <summary>
 /// 根据实体删除
 /// </summary>
 /// <param name="entity"></param>
 public void DelelteAll(string sqlWhere)
 {
     ActiveRecordBase.DeleteAll(typeof(T), sqlWhere);
 }
示例#7
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Order));
 }
示例#8
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Company));
 }
示例#9
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(uf_CarGPS_WFRoute));
 }
示例#10
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Employee));
 }
示例#11
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(QuestionContainer));
 }
示例#12
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(modeDataShare_135_set));
 }
示例#13
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(ReferenceEstrato));
 }
示例#14
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Workflow_requestbase));
 }
示例#15
0
 public new static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Client));
 }
示例#16
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(OtherDbPost));
 }
示例#17
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Person));
 }
示例#18
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Blog2));
 }
示例#19
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(NullableModel));
 }
示例#20
0
 public new static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(PersonEntity));
 }
示例#21
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Product));
 }
示例#22
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Entity));
 }
示例#23
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Award));
 }
示例#24
0
 public new static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(Repository));
 }
示例#25
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(PostLazy));
 }
示例#26
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(uf_CarGPS_WFRangeOperateRecord));
 }
示例#27
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(workflow_bill));
 }
示例#28
0
 public void DeleAll()
 {
     ActiveRecordBase.DeleteAll(typeof(T));
 }
示例#29
0
 public static void DeleteAll()
 {
     ActiveRecordBase.DeleteAll(typeof(SurveyEstrato));
 }
示例#30
0
 public void DelByWhere(string strWhere)
 {
     ActiveRecordBase.DeleteAll(typeof(T), strWhere);
 }