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

                _items = null;
            }

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