public override void Delete(BaseEntity entity) { Person u = entity as Person; GroupUserDB gudb = new GroupUserDB(); GroupUserList gul = new GroupUserList(); gul = gudb.SelectByPerson(u); foreach (GroupUser g in gul) { gudb.Delete(g); } CommentsDB cdb = new CommentsDB(); CommentsList lc = cdb.CommentsByPerson(u); foreach (Comments c in lc) { cdb.Delete(c); } MsgsDB mdb = new MsgsDB(); MsgsList ml = new MsgsList(); ml = mdb.MsgsBySender(u); foreach (Msgs m in ml) { mdb.Delete(m); } base.Delete(entity); }
public override void Delete(BaseEntity entity) { Location l = entity as Location; CommentsDB cdb = new CommentsDB(); CommentsList cl = cdb.CommentsByLocation(l); foreach (Comments c in cl) { cdb.Delete(c); } base.Delete(l); }